i am trying to install virtualenv to use python2.5 on my apple OSX 10.6 machine, but get this error when i try to:
☺ virtualenv --python=python2.5 /Users/khinester/.virtualenvs/cccorder2.5 ruby-2.0.0-p195""
Running virtualenv with interpreter /usr/bin/python2.5
New python executable in /Users/khinester/.virtualenvs/cccorder2.5/bin/python2.5
Not overwriting existing python script /Users/khinester/.virtualenvs/cccorder2.5/bin/python (you must use /Users/khinester/.virtualenvs/cccorder2.5/bin/python2.5)
Installing setuptools......................................
Complete output from command /Users/khinester/.vi...der2.5/bin/python2.5 -c "#!python
\"\"\"Bootstra...sys.argv[1:])
" --always-copy -U setuptools:
Downloading http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg
Searching for setuptools
Reading http://pypi.python.org/simple/setuptools/
Reading http://peak.telecommunity.com/snapshots/
Reading https://pypi.python.org/pypi/setuptools
Best match: setuptools 3.3
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-3.3.zip#md5=284fa92c5e32c113a4bc00bd20c4eef8
Processing setuptools-3.3.zip
Running setuptools-3.3/setup.py -q bdist_egg --dist-dir /var/folders/it/itEAjVAME2GWcW-Q6QxMBU+++TI/-Tmp-/easy_install-5rSJOe/setuptools-3.3/egg-dist-tmp-IL4Z_W
setup.py:17: Warning: 'with' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "<string>", line 278, in <module>
File "<string>", line 213, in main
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 1712, in main
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py", line 151, in setup
dist.run_commands()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py", line 974, in run_commands
self.run_command(cmd)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py", line 994, in run_command
cmd_obj.run()
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 211, in run
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 446, in easy_install
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 476, in install_item
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 655, in install_eggs
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 930, in build_and_install
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 919, in run_setup
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/sandbox.py", line 62, in run_setup
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/sandbox.py", line 105, in run
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/sandbox.py", line 64, in <lambda>
File "setup.py", line 17
with open(init_path) as init_file:
^
SyntaxError: invalid syntax
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 2577, in <module>
main()
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 979, in main
no_pip=options.no_pip)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 1091, in create_environment
search_dirs=search_dirs, never_download=never_download)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 611, in install_setuptools
search_dirs=search_dirs, never_download=never_download)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 583, in _install_req
cwd=cwd)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 1057, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/khinester/.vi...der2.5/bin/python2.5 -c "#!python
\"\"\"Bootstra...sys.argv[1:])
" --always-copy -U setuptools failed with error code 1
all other versions of python work fine, but just this.
python2.5 is fine on the machine, as per:
☺ python2.5 ruby-2.0.0-p195""
Python 2.5.4 (r254:67916, Aug 1 2011, 15:52:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print( sys.path )
['', '/Library/Python/2.5/site-packages/virtualenv-1.11.4-py2.5.egg', '/Library/Python/2.5/site-packages/MySQL_python-1.2.5-py2.5-macosx-10.6-i386.egg', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload', '/Library/Python/2.5/site-packages', '/Library/Python/2.5/site-packages/PIL', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wx-2.8-mac-unicode']
>>>
any advice much appreciated.
I think your issue is not with virtualenv but with setuptools, that dropped python 2.5 support a few months ago. You should install an older version (probably 1.X)
Related
I am trying to install xlwings module in my Ubuntu machine but failed as below
pip3 install xlwings
Collecting xlwings
Using cached https://files.pythonhosted.org/packages/cc/c9/6bb1849dbee6e8a40beb9a0d21df9787bee45cda1d0bb575a0cd388dd260/xlwings-0.15.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-u90aes_a/xlwings/setup.py", line 33, in <module>
raise OSError("currently only Windows and OSX are supported.")
OSError: currently only Windows and OSX are supported.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-u90aes_a/xlwings/
What is the resolution of this error? Is xlwings not supported in Ubuntu? I also tried to install the same manually as below but failed too.
cd xlwings
python setup.py install
Any suggestion will be highly appreciated.
Update on 10th July 2019
I ran code export INSTALL_ON_LINUX=1 and then installed xlwings. Installation was fine.
However when I tried to import xlwings in Python, that failed with below error:
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xlwings
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/xlwings/__init__.py", line 44, in <module>
from . import _xlmac as xlplatform
File "/usr/local/lib/python3.6/dist-packages/xlwings/_xlmac.py", line 10, in <module>
import aem
ModuleNotFoundError: No module named 'aem'
I could not install package aem with below error:
pip3 install aem
Collecting aem
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 795, in get_page
resp.raise_for_status()
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/aem/
Any solution will be highly appreciated.
please run this command before ruining pip install xlwings (for linux users)
export INSTALL_ON_LINUX=1
nice coding
You could potentially install Anaconda for Windows within Wine and then also install Excel within Wine and then maybe, maybe (no promises), you might find that xlwings... just... might... work... ... but there will likely be many speed bumps along the way...
I have redis and celery python libraries installed. I have redis server installed and running. using bash i can run python and import redis without errors. I have python-celery-common installed. I am using PyCharm and WSL. For some reason when i create tasks.py and try to run celery -A tasks worker --loglevel=info
in bash i get the following stack trace (note the python3 in the path to celery when i am running python 2.7 - i have a feeling this is important but not sure how, or how to change):
Traceback (most recent call last):
File "/usr/bin/celery", line 26, in <module>
load_entry_point("celery", "console_scripts", "celery")()
File "/usr/lib/python3/dist-packages/celery/__main__.py", line 14, in main
_main()
File "/usr/lib/python3/dist-packages/celery/bin/celery.py", line 326, in main
cmd.execute_from_commandline(argv)
File "/usr/lib/python3/dist-packages/celery/bin/celery.py", line 488, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "/usr/lib/python3/dist-packages/celery/bin/base.py", line 281, in execute_from_commandline
return self.handle_argv(self.prog_name, argv[1:])
File "/usr/lib/python3/dist-packages/celery/bin/celery.py", line 480, in handle_argv
return self.execute(command, argv)
File "/usr/lib/python3/dist-packages/celery/bin/celery.py", line 412, in execute
).run_from_argv(self.prog_name, argv[1:], command=argv[0])
File "/usr/lib/python3/dist-packages/celery/bin/worker.py", line 221, in run_from_argv
return self(*args, **options)
File "/usr/lib/python3/dist-packages/celery/bin/base.py", line 244, in __call__
ret = self.run(*args, **kwargs)
File "/usr/lib/python3/dist-packages/celery/bin/worker.py", line 255, in run
**kwargs)
File "/usr/lib/python3/dist-packages/celery/worker/worker.py", line 99, in __init__
self.setup_instance(**self.prepare_args(**kwargs))
File "/usr/lib/python3/dist-packages/celery/worker/worker.py", line 122, in setup_instance
self.should_use_eventloop() if use_eventloop is None
File "/usr/lib/python3/dist-packages/celery/worker/worker.py", line 241, in should_use_eventloop
self._conninfo.transport.implements.async and
File "/usr/lib/python3/dist-packages/kombu/connection.py", line 832, in transport
self._transport = self.create_transport()
File "/usr/lib/python3/dist-packages/kombu/connection.py", line 576, in create_transport
return self.get_transport_cls()(client=self)
File "/usr/lib/python3/dist-packages/kombu/transport/redis.py", line 1009, in __init__
raise ImportError('Missing redis library (pip install redis)')
ImportError: Missing redis library (pip install redis)
output from bash when i run python:
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
output from pip freeze
amqp==2.3.2
asn1crypto==0.24.0
billiard==3.5.0.5
celery==4.2.1
cryptography==2.1.4
Django==1.11.11
djangorestframework==3.9.0
enum34==1.1.6
idna==2.6
ipaddress==1.0.17
keyring==10.6.0
keyrings.alt==3.0
kombu==4.2.2
psycopg2==2.7.4
pycrypto==2.6.1
pygobject==3.26.1
pytz==2018.7
pyxdg==0.25
redis==3.0.1
SecretStorage==2.3.1
six==1.11.0
sqlparse==0.2.4
vine==1.1.4
The more plausible problem is that in pycharm when you set up the interpreter you gave it the wrong path.You set it to /usr/bin/python3 instead of the path to python2
Setup: Windows 7
Python: 3.4.3
VirtualEnv: 13.0.3
Pip: 7.0.3
I'm trying to setup a virtualenv on Window 7 but am getting the following error:
C:\test>virtualenv venv
Using base prefix 'C:\\Python34'
New python executable in venv\Scripts\python.EXE
Installing setuptools, pip, wheel...
Complete output from command C:\test\venv\Scripts\python.EXE -c "import sys, p
ip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel:
Ignoring indexes: https://pypi.python.org/simple
Collecting setuptools
Exception:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\virtualenv_support\pip-7.0.3-py2.py3-none-
any.whl\pip\basecommand.py", line 223, in main
status = self.run(options, args)
File "C:\Python34\lib\site-packages\virtualenv_support\pip-7.0.3-py2.py3-none-
any.whl\pip\commands\install.py", line 280, in run
requirement_set.prepare_files(finder)
File "C:\Python34\lib\site-packages\virtualenv_support\pip-7.0.3-py2.py3-none-
any.whl\pip\req\req_set.py", line 317, in prepare_files
functools.partial(self._prepare_file, finder))
File "C:\Python34\lib\site-packages\virtualenv_support\pip-7.0.3-py2.py3-none-
any.whl\pip\req\req_set.py", line 304, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "C:\Python34\lib\site-packages\virtualenv_support\pip-7.0.3-py2.py3-none-
any.whl\pip\req\req_set.py", line 439, in _prepare_file
req_to_install.populate_link(finder, self.upgrade)
File "C:\Python34\lib\site-packages\virtualenv_support\pip-7.0.3-py2.py3-none-
any.whl\pip\req\req_install.py", line 244, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "C:\Python34\lib\site-packages\virtualenv_support\pip-7.0.3-py2.py3-none-
any.whl\pip\index.py", line 486, in find_requirement
all_versions = self._find_all_versions(req.name)
File "C:\Python34\lib\site-packages\virtualenv_support\pip-7.0.3-py2.py3-none-
any.whl\pip\index.py", line 407, in _find_all_versions
self.find_links, expand_dir=True)
File "C:\Python34\lib\site-packages\virtualenv_support\pip-7.0.3-py2.py3-none-
any.whl\pip\index.py", line 234, in _sort_locations
sort_path(os.path.join(path, item))
File "C:\Python34\lib\site-packages\virtualenv_support\pip-7.0.3-py2.py3-none-
any.whl\pip\index.py", line 215, in sort_path
if mimetypes.guess_type(url, strict=False)[0] == 'text/html':
File "C:\Python34\Lib\mimetypes.py", line 287, in guess_type
init()
File "C:\Python34\Lib\mimetypes.py", line 348, in init
db.read_windows_registry()
File "C:\Python34\Lib\mimetypes.py", line 255, in read_windows_registry
with _winreg.OpenKey(hkcr, subkeyname) as subkey:
TypeError: OpenKey() argument 2 must be str without null characters or None, not
str
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "C:\Python34\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python34\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
File "C:\Python34\lib\site-packages\virtualenv.py", line 832, in main
symlink=options.symlink)
File "C:\Python34\lib\site-packages\virtualenv.py", line 1004, in create_envir
onment
install_wheel(to_install, py_executable, search_dirs)
File "C:\Python34\lib\site-packages\virtualenv.py", line 969, in install_wheel
'PIP_NO_INDEX': '1'
File "C:\Python34\lib\site-packages\virtualenv.py", line 910, in call_subproce
ss
% (cmd_desc, proc.returncode))
OSError: Command C:\test\venv\Scripts\python.EXE -c "import sys, pip; sys...d\"]
+ sys.argv[1:]))" setuptools pip wheel failed with error code 2
C:\test>
I've search far and wide but found no solution that solves my issue. Hoping someone can help.
It was a bug within the Python 3.4.3 installer that was supposedly fixed. I redownload and reinstalled Python but to no avail.
I managed to find the fix having followed a rabbit hole which just involved amending a mimetypes.py file
https://hg.python.org/cpython/rev/bf2016a1911f
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
I am trying to install GDAL in virtual environment based on the various solutions out there.
However the download itself already fails:
$ pip install --no-install GDAL
Here is the pip.log
------------------------------------------------------------
/Users/test/venv/bin/pip run on Sun Jun 2 15:35:15 2013
Downloading/unpacking GDAL
Running setup.py egg_info for package GDAL
running egg_info
writing pip-egg-info/GDAL.egg-info/PKG-INFO
writing top-level names to pip-egg-info/GDAL.egg-info/top_level.txt
writing dependency_links to pip-egg-info/GDAL.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/Users/test/venv/build/GDAL/setup.py", line 267, in <module>
ext_modules = ext_modules )
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "<string>", line 14, in replacement_run
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py", line 259, in find_sources
mm.run()
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py", line 325, in run
self.add_defaults()
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py", line 361, in add_defaults
sdist.add_defaults(self)
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/sdist.py", line 211, in add_defaults
build_ext = self.get_finalized_command('build_ext')
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/Users/test/venv/build/GDAL/setup.py", line 164, in finalize_options
self.gdaldir = self.get_gdal_config('prefix')
File "/Users/test/venv/build/GDAL/setup.py", line 144, in get_gdal_config
return fetch_config(option)
File "/Users/test/venv/build/GDAL/setup.py", line 97, in fetch_config
raise gdal_config_error, e""")
File "<string>", line 4, in <module>
__main__.gdal_config_error: [Errno 2] No such file or directory
Complete output from command python setup.py egg_info:
running egg_info
writing pip-egg-info/GDAL.egg-info/PKG-INFO
writing top-level names to pip-egg-info/GDAL.egg-info/top_level.txt
writing dependency_links to pip-egg-info/GDAL.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/Users/test/venv/build/GDAL/setup.py", line 267, in <module>
ext_modules = ext_modules )
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "<string>", line 14, in replacement_run
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py", line 259, in find_sources
mm.run()
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py", line 325, in run
self.add_defaults()
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py", line 361, in add_defaults
sdist.add_defaults(self)
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/sdist.py", line 211, in add_defaults
build_ext = self.get_finalized_command('build_ext')
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/Users/test/venv/build/GDAL/setup.py", line 164, in finalize_options
self.gdaldir = self.get_gdal_config('prefix')
File "/Users/test/venv/build/GDAL/setup.py", line 144, in get_gdal_config
return fetch_config(option)
File "/Users/test/venv/build/GDAL/setup.py", line 97, in fetch_config
raise gdal_config_error, e""")
File "<string>", line 4, in <module>
__main__.gdal_config_error: [Errno 2] No such file or directory
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /Users/test/venv/build/GDAL
Exception information:
Traceback (most recent call last):
File "/Users/test/venv/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main
status = self.run(options, args)
File "/Users/test/venv/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/install.py", line 266, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/test/venv/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1057, in prepare_files
req_to_install.run_egg_info()
File "/Users/test/venv/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 236, in run_egg_info
command_desc='python setup.py egg_info')
File "/Users/test/venv/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/util.py", line 662, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /Users/test/venv/build/GDAL
What am I missing?
The workaround given by #user1738154 didn't work as expected for me so went ahead and installed GDAL using HomeBrew then using pip into my Virtual environment.
$ brew install gdal
(venv)$ pip install GDAL
Everything compiled and ran like a charm.
A workaround to that problem is to
Download GDAL Complete from this site
Install GDAL Complete.pkg
Go to /Library/Frameworks/GDAL.framework/Versions/1.10/ and copy all files in there
Go to your virtual environment's sites-packages /venv/lib/python2.7/site-packages and paste the copied files in there
after install gdal using these steps on host:
sudo apt-get install gdal-bin
sudo apt-get install libgdal-dev
After that use
pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="-I/usr/include/gdal"
This should work like charm