Pip3: Cython error while installing spicy - python

This is my requirements.txt file below:
emoji==1.2.0
langdetect==1.0.8
Pillow==9.0.0
PyMySQL==0.10.1
pyOpenSSL==19.1.0
pytz==2020.1
redis==3.5.3
regex==2021.8.3
requests==2.24.0
selenium==3.141.0
nltk==3.6.6
cython==0.29.26
numpy==1.21.1
setuptools==59.6.0
scipy==1.5.4
geograpy3==0.2.2
geotext~=0.4.0
DateTime~=4.3
uuid~=1.30
Jinja2~=2.11.2
boto3==1.17.3
Traceback
Collecting selenium==3.141.0 (from -r requirements.txt (line 10))
Using cached https://files.pythonhosted.org/packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl
Collecting nltk==3.6.6 (from -r requirements.txt (line 11))
Using cached https://files.pythonhosted.org/packages/90/35/8848a41a983a923aa2496fbe4ee4df796c6b32b2a59f04c2b2047aafd3c3/nltk-3.6.6-py3-none-any.whl
Collecting cython==0.29.26 (from -r requirements.txt (line 12))
Using cached https://files.pythonhosted.org/packages/15/29/2abb8975ded365d55b9e14129cabdfb977255911c80d8709028eca5829cd/Cython-0.29.26-py2.py3-none-any.whl
Collecting numpy==1.21.1 (from -r requirements.txt (line 13))
Using cached https://files.pythonhosted.org/packages/0b/a7/e724c8df240687b5fd62d8c71f1a6709d455c4c09432c7412e3e64f4cbe5/numpy-1.21.1.zip
Collecting setuptools==59.6.0 (from -r requirements.txt (line 14))
Using cached https://files.pythonhosted.org/packages/b0/3a/88b210db68e56854d0bcf4b38e165e03be377e13907746f825790f3df5bf/setuptools-59.6.0-py3-none-any.whl
Collecting scipy==1.5.4 (from -r requirements.txt (line 15))
Using cached https://files.pythonhosted.org/packages/aa/d5/dd06fe0e274e579e1dff21aa021219c039df40e39709fabe559faed072a5/scipy-1.5.4.tar.gz
Complete output from command python setup.py egg_info:
Processing numpy/random/_bounded_integers.pxd.in
Processing numpy/random/_philox.pyx
Traceback (most recent call last):
File "/tmp/easy_install-5cn5y70d/numpy-1.22.3/tools/cythonize.py", line 53, in process_pyx
import Cython
ModuleNotFoundError: No module named 'Cython'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/tmp/easy_install-5cn5y70d/numpy-1.22.3/tools/cythonize.py", line 234, in <module>
main()
File "/tmp/easy_install-5cn5y70d/numpy-1.22.3/tools/cythonize.py", line 230, in main
find_process_files(root_dir)
File "/tmp/easy_install-5cn5y70d/numpy-1.22.3/tools/cythonize.py", line 221, in find_process_files
process(root_dir, fromfile, tofile, function, hash_db)
File "/tmp/easy_install-5cn5y70d/numpy-1.22.3/tools/cythonize.py", line 187, in process
processor_function(fromfile, tofile)
File "/tmp/easy_install-5cn5y70d/numpy-1.22.3/tools/cythonize.py", line 60, in process_pyx
raise OSError(msg) from e
OSError: Cython needs to be installed in Python as a module
Running from numpy source directory.
Traceback (most recent call last):
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-5cn5y70d/numpy-1.22.3/setup.py", line 461, in <module>
"generating Cython sources and expanding templates".format(
File "/tmp/easy_install-5cn5y70d/numpy-1.22.3/setup.py", line 443, in setup_package
bad_commands[command] = "`setup.py %s` is not supported" % command
File "/tmp/easy_install-5cn5y70d/numpy-1.22.3/setup.py", line 248, in generate_cython
f.write(text)
RuntimeError: Running cythonize failed!
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-tqtljvxv/scipy/setup.py", line 583, in <module>
setup_package()
File "/tmp/pip-build-tqtljvxv/scipy/setup.py", line 579, in setup_package
setup(**metadata)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/__init__.py", line 128, in setup
_install_setup_requires(attrs)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/dist.py", line 510, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/pkg_resources/__init__.py", line 772, in resolve
dist = best[req.key] = env.best_match(
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1057, in best_match
return self.obtain(req, installer)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1069, in obtain
return installer(requirement)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/dist.py", line 580, in fetch_build_egg
return cmd.easy_install(req)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 698, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 724, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 909, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 1177, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 1163, in run_setup
run_setup(setup_script, args)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/sandbox.py", line 253, in run_setup
raise
File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/_vendor/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/home/odroid/Documents/data-crawling-env/lib/python3.8/site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-5cn5y70d/numpy-1.22.3/setup.py", line 461, in <module>
"generating Cython sources and expanding templates".format(
File "/tmp/easy_install-5cn5y70d/numpy-1.22.3/setup.py", line 443, in setup_package
bad_commands[command] = "`setup.py %s` is not supported" % command
File "/tmp/easy_install-5cn5y70d/numpy-1.22.3/setup.py", line 248, in generate_cython
f.write(text)
RuntimeError: Running cythonize failed!
Cythonizing sources
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-tqtljvxv/scipy/
It looks like related to Cython in spicy package? Does anyone got this error.
Thank you guy for helping me.

I fixed this problem.
The reason is my pip3 version was too old (v.9).
So I updated it to the newest version, it work like charm.
sudo python3 -m pip install -U pip

Related

pip install pandas without upgrading pip

I am now trying to run a program on a super computer on which I cannot run sudo or easy_install. The program needs pandas so I need to pip install pandas but I keep getting this error message even thought I have tried "pip install --upgrade pip" already.
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
--edit--
Here is the error message when I pip3 install pandas.
pip3 install pandas
Collecting pandas
Using cached pandas-0.22.0.tar.gz
Complete output from command python setup.py egg_info:
Running from numpy source directory.
/tmp/easy_install-gv5il123/numpy-1.14.1/setup.py:369: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
/usr/lib64/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/system_info.py:624: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
/usr/lib64/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
/usr/lib64/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 239, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 269, in run
return func()
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 238, in runner
_execfile(setup_script, ns)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 46, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-gv5il123/numpy-1.14.1/setup.py", line 394, in <module>
File "/tmp/easy_install-gv5il123/numpy-1.14.1/setup.py", line 386, in setup_package
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/core.py", line 169, in setup
File "/usr/lib64/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.4/site-packages/setuptools/command/bdist_egg.py", line 151, in run
self.run_command("egg_info")
File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/egg_info.py", line 26, in run
File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 148, in run
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 165, in build_sources
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 324, in build_extension_sources
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 377, in generate_sources
File "numpy/core/setup.py", line 422, in generate_config_h
return tag
File "numpy/core/setup.py", line 48, in check_types
min_numpy_ver = '1.9.0'
File "numpy/core/setup.py", line 281, in check_types
pjoin(ujson_lib,'ultrajsondec.c'),
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-xqyfs1o1/pandas/setup.py", line 743, in <module>
**setuptools_kwargs)
File "/usr/lib64/python3.4/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 268, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 312, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 846, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1091, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1103, in obtain
return installer(requirement)
File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 379, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 638, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 668, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 851, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1079, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1065, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 242, in run_setup
raise
File "/usr/lib64/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib64/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 141, in resume
compat.reraise(type, exc, self._tb)
File "/usr/lib/python3.4/site-packages/setuptools/compat.py", line 69, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 239, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 269, in run
return func()
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 238, in runner
_execfile(setup_script, ns)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 46, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-gv5il123/numpy-1.14.1/setup.py", line 394, in <module>
File "/tmp/easy_install-gv5il123/numpy-1.14.1/setup.py", line 386, in setup_package
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/core.py", line 169, in setup
File "/usr/lib64/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.4/site-packages/setuptools/command/bdist_egg.py", line 151, in run
self.run_command("egg_info")
File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/egg_info.py", line 26, in run
File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 148, in run
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 165, in build_sources
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 324, in build_extension_sources
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 377, in generate_sources
File "numpy/core/setup.py", line 422, in generate_config_h
return tag
File "numpy/core/setup.py", line 48, in check_types
min_numpy_ver = '1.9.0'
File "numpy/core/setup.py", line 281, in check_types
pjoin(ujson_lib,'ultrajsondec.c'),
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
/tmp/easy_install-gv5il123/numpy-1.14.1/temp/tmpsx06jzi5/source.c:1:19: fatal error: cblas.h: No such file or directory
#include <cblas.h>
^
compilation terminated.
/tmp/easy_install-gv5il123/numpy-1.14.1/temp/tmpsx06jzi5/source.c:1:19: fatal error: cblas.h: No such file or directory
#include <cblas.h>
^
compilation terminated.
non-existing path in 'numpy/distutils': 'site.cfg'
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’
int exp (void);
^~~
_configtest.o: In function `main':
/tmp/easy_install-gv5il123/numpy-1.14.1/_configtest.c:6: undefined reference to `exp'
collect2: error: ld returned 1 exit status
_configtest.o: In function `main':
/tmp/easy_install-gv5il123/numpy-1.14.1/_configtest.c:6: undefined reference to `exp'
collect2: error: ld returned 1 exit status
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’
int exp (void);
^~~
_configtest.c:1:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
_configtest.c:1:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
/tmp/pip-build-xqyfs1o1/pandas/
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
You are missing the packages python-dev and python-devel.
But since you are not root on that server you probably cannot install them yourself. Basically you could ask the administrator if he could install them for you.
I would recommend installing a local version of Python and install the packages there.
By the way: Since you are not root pip would fail anyways since you probably do not have the right to globally install packages. You should use pip install <package> --user instead.

Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 while Installing PyNaCl

I'm trying to install PyNaCl on Ubuntu 16.04 and I'm getting the error on the title; this is the whole traceback:
Collecting PyNaCl
Using cached PyNaCl-1.0.1.tar.gz
Complete output from command python setup.py egg_info:
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
warning: build_py: byte-compiling is disabled, skipping.
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
compilation terminated.
Traceback (most recent call last):
File "/usr/lib/python3.5/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/usr/lib/python3.5/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/usr/lib/python3.5/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/usr/lib/python3.5/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/command/bdist_egg.py", line 161, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/command/bdist_egg.py", line 147, in call_command
self.run_command(cmdname)
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/usr/lib/python3.5/distutils/command/install_lib.py", line 109, in build
self.run_command('build_ext')
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/command/build_ext.py", line 75, in run
_build_ext.run(self)
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 338, in run
self.build_extensions()
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 447, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 472, in _build_extensions_serial
self.build_extension(ext)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
_build_ext.build_extension(self, ext)
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 532, in build_extension
depends=ext.depends)
File "/usr/lib/python3.5/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/usr/lib/python3.5/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 157, in save_modules
yield saved
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 198, in setup_context
yield
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 248, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 278, in run
return func()
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 246, in runner
_execfile(setup_script, ns)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-ek_ikn33/cffi-1.8.3/setup.py", line 193, in <module>
subprocess.check_call(["make", "check"], cwd=build_temp)
File "/usr/lib/python3.5/distutils/core.py", line 163, in setup
raise SystemExit("error: " + str(msg))
SystemExit: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1101, in run_setup
run_setup(setup_script, args)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 251, in run_setup
raise
File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 198, in setup_context
yield
File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 169, in save_modules
saved_exc.resume()
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 144, in resume
six.reraise(type, exc, self._tb)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/pkg_resources/_vendor/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 157, in save_modules
yield saved
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 198, in setup_context
yield
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 248, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 278, in run
return func()
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 246, in runner
_execfile(setup_script, ns)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-ek_ikn33/cffi-1.8.3/setup.py", line 193, in <module>
subprocess.check_call(["make", "check"], cwd=build_temp)
File "/usr/lib/python3.5/distutils/core.py", line 163, in setup
raise SystemExit("error: " + str(msg))
SystemExit: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pycharm-packaging/PyNaCl/setup.py", line 259, in <module>
"Programming Language :: Python :: 3.5",
File "/usr/lib/python3.5/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/dist.py", line 315, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs
replace_conflicting=True,
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 826, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1092, in best_match
return self.obtain(req, installer)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1104, in obtain
return installer(requirement)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/dist.py", line 429, in fetch_build_egg
return cmd.easy_install(req)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 665, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 695, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 876, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1115, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/miguel/PycharmProjects/Crossed/Crossedenv/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1103, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pycharm-packaging/PyNaCl/
I searched some workarounds that worked for other people but they're for oter packages and didn't work for me. Thanks for any help.
Looks like you are missing CFFI, which also has a couple of dependencies. According to this you need to install a couple of dependencies, probably python-dev and libffi-dev.

Install Scrapy error on Mac OS 10.9.4

I am using mac ox 10.9.4, with python 2.7.6. I am trying to install the Scrapy by
pip install Scrapy
After some downloadsthe following happens:
Running setup.py (path:/private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/pyOpenSSL/setup.py) egg_info for package pyOpenSSL
warning: no previously-included files matching '*.pyc' found anywhere in distribution
no previously-included directories found matching 'doc/_build'
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in ./anaconda/lib/python2.7/site-packages (from Scrapy)
Downloading/unpacking queuelib (from Scrapy)
Downloading queuelib-1.2.2-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): lxml in ./anaconda/lib/python2.7/site-packages (from Scrapy)
Downloading/unpacking w3lib>=1.8.0 (from Scrapy)
Downloading w3lib-1.10.0-py2.py3-none-any.whl
Downloading/unpacking cssselect>=0.9 (from Scrapy)
Downloading cssselect-0.9.1.tar.gz
Running setup.py (path:/private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/cssselect/setup.py) egg_info for package cssselect
no previously-included directories found matching 'docs/_build'
Downloading/unpacking Twisted>=10.0.0 (from Scrapy)
Downloading Twisted-14.0.2.tar.bz2 (4.3MB): 4.3MB downloaded
Running setup.py (path:/private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/Twisted/setup.py) egg_info for package Twisted
Downloading/unpacking cryptography>=0.2.1 (from pyOpenSSL->Scrapy)
Downloading cryptography-0.5.4.tar.gz (320kB): 320kB downloaded
Running setup.py (path:/private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/cryptography/setup.py) egg_info for package cryptography
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/cryptography/setup.py", line 174, in <module>
"test": PyTest,
File "/Users/nereus/anaconda/lib/python2.7/distutils/core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/dist.py", line 239, in __init__
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/dist.py", line 264, in fetch_build_eggs
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/pkg_resources.py", line 580, in resolve
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/pkg_resources.py", line 818, in best_match
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/pkg_resources.py", line 830, in obtain
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/dist.py", line 314, in fetch_build_egg
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 593, in easy_install
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 623, in install_item
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 809, in install_eggs
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 1015, in build_and_install
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 1000, in run_setup
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/sandbox.py", line 50, in run_setup
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/sandbox.py", line 100, in run
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/sandbox.py", line 52, in <lambda>
File "setup.py", line 86, in <module>
File "setup.py", line 49, in ask_supports_thread
"iso8601",
File "/Users/nereus/anaconda/lib/python2.7/distutils/command/config.py", line 230, in try_compile
self._check_compiler()
File "/Users/nereus/anaconda/lib/python2.7/distutils/command/config.py", line 103, in _check_compiler
customize_compiler(self.compiler)
File "/Users/nereus/anaconda/lib/python2.7/distutils/sysconfig.py", line 170, in customize_compiler
_osx_support.customize_compiler(_config_vars)
File "/Users/nereus/anaconda/lib/python2.7/_osx_support.py", line 418, in customize_compiler
_find_appropriate_compiler(_config_vars)
File "/Users/nereus/anaconda/lib/python2.7/_osx_support.py", line 185, in _find_appropriate_compiler
if 'llvm-gcc' in data:
TypeError: argument of type 'NoneType' is not iterable
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/cryptography/setup.py", line 174, in <module>
"test": PyTest,
File "/Users/nereus/anaconda/lib/python2.7/distutils/core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/dist.py", line 239, in __init__
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/dist.py", line 264, in fetch_build_eggs
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/pkg_resources.py", line 580, in resolve
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/pkg_resources.py", line 818, in best_match
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/pkg_resources.py", line 830, in obtain
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/dist.py", line 314, in fetch_build_egg
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 593, in easy_install
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 623, in install_item
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 809, in install_eggs
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 1015, in build_and_install
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 1000, in run_setup
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/sandbox.py", line 50, in run_setup
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/sandbox.py", line 100, in run
File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/sandbox.py", line 52, in <lambda>
File "setup.py", line 86, in <module>
File "setup.py", line 49, in ask_supports_thread
"iso8601",
File "/Users/nereus/anaconda/lib/python2.7/distutils/command/config.py", line 230, in try_compile
self._check_compiler()
File "/Users/nereus/anaconda/lib/python2.7/distutils/command/config.py", line 103, in _check_compiler
customize_compiler(self.compiler)
File "/Users/nereus/anaconda/lib/python2.7/distutils/sysconfig.py", line 170, in customize_compiler
_osx_support.customize_compiler(_config_vars)
File "/Users/nereus/anaconda/lib/python2.7/_osx_support.py", line 418, in customize_compiler
_find_appropriate_compiler(_config_vars)
File "/Users/nereus/anaconda/lib/python2.7/_osx_support.py", line 185, in _find_appropriate_compiler
if 'llvm-gcc' in data:
TypeError: argument of type 'NoneType' is not iterable
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/cryptography
Storing debug log for failure in /Users/nereus/.pip/pip.log
Could anyone please help me to figure it out?
Thank you so mcuh.
Have you installed the xcode command line tools? Try running this command:
xcode-select --install
I found it easier to use anaconda. install that first. then you can do
conda install scrapy
anaconda is a full featured python distro that is self contained.

compiling statsmodels example in ubuntu 12.04

I am new to python, and after reading the running some examples, I wanted to try statsmodels.
I copied the following example from statsmodels website,
#!/usr/bin/env python3
import numpy as np
import statsmodels.api as sm
spector_data = sm.datasets.spector.load()
spector_data.exog = sm.add_constant(spector_data.exog, prepend=False)
#Fit and summarize OLS model
mod = sm.OLS(spector_data.endog, spector_data.exog)
res = mod.fit()
print (res.summary())
and I get the following error:
Running unit tests for scipy
Traceback (most recent call last):
File "./statsmodels.py", line 3, in <module>
import statsmodels.api as sm
File "/home/ra/python/statsmodels.py", line 3, in <module>
scipy.test()
File "/usr/lib/python3/dist-packages/numpy/testing/nosetester.py", line 318, in test
self._show_system_info()
File "/usr/lib/python3/dist-packages/numpy/testing/nosetester.py", line 187, in _show_system_info
nose = import_nose()
File "/usr/lib/python3/dist-packages/numpy/testing/nosetester.py", line 69, in import_nose
raise ImportError(msg)
ImportError: Need nose >= 0.10.0 for tests - see http://somethingaboutorange.com/mrl/projects/nose
so, I ran the below command for statsmodels, and it gave me the following message upon running the install:
sudo easy_install3 -U statsmodels
Searching for statsmodels
Reading http://pypi.python.org/simple/statsmodels/
Reading http://statsmodels.sourceforge.net/
Reading https://github.com/statsmodels/statsmodels/downloads
Best match: statsmodels 0.5.0
Downloading https://pypi.python.org/packages/source/s/statsmodels/statsmodels-0.5.0.zip#md5=4ed78e8c6ababdcae0400fc0fe6f31a7
Processing statsmodels-0.5.0.zip
Running statsmodels-0.5.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-hnrc4z/statsmodels-0.5.0/egg-dist-tmp-2_kign
Traceback (most recent call last):
File "setup.py", line 116, in check_dependency_versions
ImportError: No module named pandas.version
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/easy_install3", line 9, in <module>
load_entry_point('distribute==0.6.24dev-r0', 'console_scripts', 'easy_install')()
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1931, in main
with_ei_usage(lambda:
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1912, in with_ei_usage
return f()
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1935, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/lib/python3.2/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.2/distutils/dist.py", line 917, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.2/distutils/dist.py", line 936, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 368, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 608, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 638, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 828, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1105, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1094, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 31, in run_setup
lambda: exec(compile(open(
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 73, in run
return func()
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 34, in <lambda>
{'__file__':setup_script, '__name__':'__main__'})
File "setup.py", line 463, in <module>
File "setup.py", line 118, in check_dependency_versions
ImportError: statsmodels requires pandas
So, I ran the below to make sure I had the latest pandas (I had run the sudo apt-get install python-pandas before, but since statsmodels did not find that, I did the below:
sudo easy_install3 -U pandas
Searching for pandas
Reading http://pypi.python.org/simple/pandas/
Best match: pandas 0.14.0
Downloading https://pypi.python.org/packages/source/p/pandas/pandas-0.14.0.zip#md5=9afe57bd470a2ddaf67bdfb5fc9c0eee
Processing pandas-0.14.0.zip
Running pandas-0.14.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-deg0nw/pandas-0.14.0/egg-dist-tmp-19hrp_
warning: no files found matching 'README.rst'
no previously-included directories found matching 'doc/build'
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.png' found anywhere in distribution
pandas/index.c:4:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
Where's my error this time.
btw, this is the version of pandas I see from my python prompt:
>>> import pandas
/usr/local/lib/python2.7/dist-packages/pandas/io/excel.py:626: UserWarning: Installed openpyxl is not supported at this time. Use >=1.6.1 and <2.0.0.
.format(openpyxl_compat.start_ver, openpyxl_compat.stop_ver))
>>> pandas.__version__
'0.14.0'
I don't understand why I get that message when I import.
Also, I wanted to post the results of which, in case that might be of any use:
ra#ra-VGN-FZ:~$ which python
/usr/bin/python
ra#ra-VGN-FZ:~$ which easy_install
/usr/bin/easy_install
ra#ra-VGN-FZ:~$ which pip3
/usr/local/bin/pip3
To solve openpyxl problem, I did the following:
pip uninstall openpyxl
Cannot uninstall requirement openpyxl, not installed
Storing debug log for failure in /tmp/tmpci3yro
ra#ra-VGN-FZ19:~$ pip install openpyxl==1.8.6
Downloading/unpacking openpyxl==1.8.6
Downloading openpyxl-1.8.6-py2.py3-none-any.whl (190kB): 190kB downloaded
Installing collected packages: openpyxl
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.2/dist-packages/pip-1.5.6-py3.2.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python3.2/dist-packages/pip-1.5.6-py3.2.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/local/lib/python3.2/dist-packages/pip-1.5.6-py3.2.egg/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/local/lib/python3.2/dist-packages/pip-1.5.6-py3.2.egg/pip/req.py", line 671, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/local/lib/python3.2/dist-packages/pip-1.5.6-py3.2.egg/pip/req.py", line 901, in move_wheel_files
pycompile=self.pycompile,
File "/usr/local/lib/python3.2/dist-packages/pip-1.5.6-py3.2.egg/pip/wheel.py", line 215, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/local/lib/python3.2/dist-packages/pip-1.5.6-py3.2.egg/pip/wheel.py", line 205, in clobber
os.makedirs(destdir)
File "/usr/lib/python3.2/os.py", line 152, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python3.2/dist-packages/openpyxl-1.8.6.dist-info'
Storing debug log for failure in /tmp/tmp15h3o4
This is the error with python3:
sudo easy_install3 -U statsmodels
Searching for statsmodels
Reading http://pypi.python.org/simple/statsmodels/
Reading http://statsmodels.sourceforge.net/
Reading https://github.com/statsmodels/statsmodels/downloads
Best match: statsmodels 0.5.0
Downloading https://pypi.python.org/packages/source/s/statsmodels/statsmodels-0.5.0.zip#md5=4ed78e8c6ababdcae0400fc0fe6f31a7
Processing statsmodels-0.5.0.zip
Running statsmodels-0.5.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-oudla7/statsmodels-0.5.0/egg-dist-tmp-o6dh5a
Traceback (most recent call last):
File "setup.py", line 120, in check_dependency_versions
ImportError: No module named patsy
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/easy_install3", line 9, in <module>
load_entry_point('distribute==0.6.24dev-r0', 'console_scripts', 'easy_install')()
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1931, in main
with_ei_usage(lambda:
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1912, in with_ei_usage
return f()
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1935, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/lib/python3.2/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.2/distutils/dist.py", line 917, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.2/distutils/dist.py", line 936, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 368, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 608, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 638, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 828, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1105, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1094, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 31, in run_setup
lambda: exec(compile(open(
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 73, in run
return func()
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 34, in <lambda>
{'__file__':setup_script, '__name__':'__main__'})
File "setup.py", line 463, in <module>
File "setup.py", line 122, in check_dependency_versions
ImportError: statsmodels requires patsy. http://patsy.readthedocs.org
ra#ra-VGN-FZ19:~$ sudo easy_install3 -U patsy
Searching for patsy
Reading http://pypi.python.org/simple/patsy/
Best match: patsy 0.2.1
Downloading https://pypi.python.org/packages/source/p/patsy/patsy-0.2.1.zip#md5=d51fa2fcb60018d75073f375c87ddccf
Processing patsy-0.2.1.zip
Running patsy-0.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-l1wpxc/patsy-0.2.1/egg-dist-tmp-2qgd7e
no previously-included directories found matching 'doc/_build'
zip_safe flag not set; analyzing archive contents...
Adding patsy 0.2.1 to easy-install.pth file
Installed /usr/local/lib/python3.2/dist-packages/patsy-0.2.1-py3.2.egg
Processing dependencies for patsy
Finished processing dependencies for patsy
Thanks to Jonathan Villemaire-Krajden who misled me while i was seeking a solution to show() in matplotlib, my statsmodels has broken.
I tried to reinstall statsmodels and now I get the following error:
easy_install3 -U statsmodels
Traceback (most recent call last):
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 449, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 742, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 643, in resolve
raise VersionConflict(dist, req) # XXX put more info here
pkg_resources.VersionConflict: (distribute 0.7.3 (/usr/local/lib/python3.2/dist-packages/distribute-0.7.3-py3.2.egg), Requirement.parse('distribute==0.6.24dev-r0'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/easy_install3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 2837, in <module>
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 451, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 464, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 799, in __init__
self.scan(search_path)
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 829, in scan
self.add(dist)
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 849, in add
dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
TypeError: unorderable types: NoneType() < str()
ra#ra-VGN-FZ19:~$ sudo easy_install3 -U statsmodels
Traceback (most recent call last):
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 449, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 742, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 643, in resolve
raise VersionConflict(dist, req) # XXX put more info here
pkg_resources.VersionConflict: (distribute 0.7.3 (/usr/local/lib/python3.2/dist-packages/distribute-0.7.3-py3.2.egg), Requirement.parse('distribute==0.6.24dev-r0'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/easy_install3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 2837, in <module>
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 451, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 464, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 799, in __init__
self.scan(search_path)
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 829, in scan
self.add(dist)
File "/usr/local/lib/python3.2/dist-packages/setuptools-5.1-py3.2.egg/pkg_resources.py", line 849, in add
dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
TypeError: unorderable types: NoneType() < str()
sudo pip3 install statsmodels
Downloading/unpacking statsmodels
Downloading statsmodels-0.5.0.tar.gz (5.5MB): 5.5MB downloaded
Running setup.py (path:/tmp/pip_build_root/statsmodels/setup.py) egg_info for package statsmodels
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/statsmodels/setup.py", line 463, in <module>
check_dependency_versions(min_versions)
File "/tmp/pip_build_root/statsmodels/setup.py", line 109, in check_dependency_versions
from scipy.version import short_version as spversion
File "/usr/lib/python3/dist-packages/scipy/__init__.py", line 124, in <module>
pkgload(verbose=SCIPY_IMPORT_VERBOSE,postpone=True)
File "/usr/local/lib/python3.2/dist-packages/numpy/_import_tools.py", line 177, in __call__
for package_name in self._get_sorted_names():
File "/usr/local/lib/python3.2/dist-packages/numpy/_import_tools.py", line 114, in _get_sorted_names
for name in depend_dict.keys():
RuntimeError: dictionary changed size during iteration
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/statsmodels/setup.py", line 463, in <module>
check_dependency_versions(min_versions)
File "/tmp/pip_build_root/statsmodels/setup.py", line 109, in check_dependency_versions
from scipy.version import short_version as spversion
File "/usr/lib/python3/dist-packages/scipy/__init__.py", line 124, in <module>
pkgload(verbose=SCIPY_IMPORT_VERBOSE,postpone=True)
File "/usr/local/lib/python3.2/dist-packages/numpy/_import_tools.py", line 177, in __call__
for package_name in self._get_sorted_names():
File "/usr/local/lib/python3.2/dist-packages/numpy/_import_tools.py", line 114, in _get_sorted_names
for name in depend_dict.keys():
RuntimeError: dictionary changed size during iteration
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/statsmodels
Storing debug log for failure in /home/ra/.pip/pip.log
You are running statsmodels.py with Python 3, and almost certainly running ipython with Python 2.
When you install with pip it usesPython 2, and installs the packages in a different location than where Python 3 looks.
Either install nose using pip3 (if you have it installed - read here if not)
sudo pip3 install nose
or run your statsmodels.py with Python 2 (replace python3 with python on your first line):
#!/usr/bin/env python

pip install requirement fails

I am facing an issue while trying to install the requirements for my django project.
I am unable to figure out why I'm getting this error.
Can someone lead me in the right direction?
>Running setup.py egg_info for package django-staticfiles
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/Users/glosseyvilly/Desktop/Workspace/chris_dev/mysite-env/build/django-staticfiles/setup.py", line 128, in <module>
'versiontools >= 1.6',
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 113, in setup
_setup_distribution = dist = klass(attrs)
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 260, in __init__
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 284, in fetch_build_eggs
File "build/bdist.linux-i686/egg/pkg_resources.py", line 563, in resolve
plugin_projects = list(plugin_env)
File "build/bdist.linux-i686/egg/pkg_resources.py", line 799, in best_match
File "build/bdist.linux-i686/egg/pkg_resources.py", line 811, in obtain
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 327, in fetch_build_egg
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 446, in easy_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 476, in install_item
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 655, in install_eggs
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 930, in build_and_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 919, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 62, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 105, in run
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 64, in <lambda>
File "setup.py", line 29, in <module>
in a distutils ``setup.py`` file.
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 354, in format_version
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 183, in from_tuple
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 126, in __new__
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 279, in _find_source_tree
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 936, in getouterframes
framelist.append((frame,) + getframeinfo(frame, context))
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 911, in getframeinfo
lines, lnum = findsource(frame)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 573, in findsource
if pat.match(lines[lnum]): break
IndexError: list index out of range
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/Users/glosseyvilly/Desktop/Workspace/chris_dev/mysite-env/build/django-staticfiles/setup.py", line 128, in <module>
'versiontools >= 1.6',
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 113, in setup
_setup_distribution = dist = klass(attrs)
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 260, in __init__
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 284, in fetch_build_eggs
File "build/bdist.linux-i686/egg/pkg_resources.py", line 563, in resolve
plugin_projects = list(plugin_env)
File "build/bdist.linux-i686/egg/pkg_resources.py", line 799, in best_match
File "build/bdist.linux-i686/egg/pkg_resources.py", line 811, in obtain
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 327, in fetch_build_egg
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 446, in easy_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 476, in install_item
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 655, in install_eggs
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 930, in build_and_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 919, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 62, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 105, in run
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 64, in <lambda>
File "setup.py", line 29, in <module>
in a distutils ``setup.py`` file.
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 354, in format_version
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 183, in from_tuple
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 126, in __new__
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 279, in _find_source_tree
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 936, in getouterframes
framelist.append((frame,) + getframeinfo(frame, context))
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 911, in getframeinfo
lines, lnum = findsource(frame)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 573, in findsource
if pat.match(lines[lnum]): break
IndexError: list index out of range
----------------------------------------
Command python setup.py egg_info failed with error code 1
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/commands/install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/req.py", line 986, in prepare_files
req_to_install.run_egg_info()
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/req.py", line 222, in run_egg_info
command_desc='python setup.py egg_info')
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/__init__.py", line 255, in call_subprocess
% (command_desc, proc.returncode))
InstallationError: Command python setup.py egg_info failed with error code 1
I ran into this same error while using the native Python 2.6.1 on Mac OS X 10.6 to install django-imagekit. Some googling revealed this:
https://github.com/jezdez/django_compressor/issues/181
which suggested this:
pip install versiontools
and then I was able to install django-imagekit.
Same issue when I try to install MySQL-python
apt-get install libmysqlclient-dev python-dev
solved my problem.
I think you need to install the python-dev version. Hope that helps
From this error
framelist.append((frame,) + getframeinfo(frame, context))
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 911, in getframeinfo
lines, lnum = findsource(frame)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 573, in findsource
if pat.match(lines[lnum]): break
IndexError: list index out of range
it appears that findsource(frame) is unable to find a legal lnum for frame. Are you sure that all the programs are aligned to known compatible versions (python, django, pip, etc)?
Before risking to pollute your system installation of python, I suggest that you use virtualenv to isolate the python environment from the one shipped with the OS.

Categories