Encoding error when attempt to install matplotlib on ubuntu - python

I'm attempting to install matplotlib in a python2 virtualenv in Ubuntu 14.04, and am running into the following error:
../virtualenv/bin/pip install matplotlib
Traceback (most recent call last):
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/commands/install.py", line 305, in run
wb.build(autobuilding=True)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/wheel.py", line 705, in build
self.requirement_set.prepare_files(self.finder)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/req/req_set.py", line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/req/req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/req/req_set.py", line 491, in _prepare_file
session=self.session)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/download.py", line 825, in unpack_url
session,
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/download.py", line 673, in unpack_http_url
from_path, content_type = _download_http_url(link, session, temp_dir)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/download.py", line 886, in _download_http_url
_download_url(resp, link, content_file)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/download.py", line 621, in _download_url
for chunk in progress_indicator(resp_read(4096), 4096):
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/utils/ui.py", line 133, in iter
for x in it:
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/download.py", line 586, in resp_read
decode_content=False):
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 307, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 243, in read
data = self._fp.read(amt)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 54, in read
self.__callback(self.__buf.getvalue())
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py", line 224, in cache_response
self.serializer.dumps(request, response, body=body),
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 49, in dumps
"body": _b64_encode_bytes(body),
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 12, in _b64_encode_bytes
return base64.b64encode(b).decode("ascii")
MemoryError
Any thoughts about what might be going on and why I am getting a Memory Error?

This appears to be the MemoryError while trying to install a large package (matplotlib) in a low memory environment. It appears that the cause is the caching mechanism, as disabling the cache fixes the issue.
Try this:
pip install --no-cache-dir matplotlib

Related

Cant install pip modules

ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\cli\base_command.
py", line 216, in _main
status = self.run(options, args)
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\cli\req_command.p
y", line 182, in wrapper
return func(self, options, args)
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\commands\install.
py", line 324, in run
requirement_set = resolver.resolve(
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\resolution\legacy
\resolver.py", line 183, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\resolution\legacy
\resolver.py", line 388, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\resolution\legacy
\resolver.py", line 340, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\operations\prepar
e.py", line 467, in prepare_linked_requirement
local_file = unpack_url(
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\operations\prepar
e.py", line 255, in unpack_url
file = get_http_url(
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\operations\prepar
e.py", line 129, in get_http_url
from_path, content_type = _download_http_url(
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\operations\prepar
e.py", line 282, in _download_http_url
for chunk in download.chunks:
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\cli\progress_bars
.py", line 172, in iter
self.next(len(x)) # noqa: B305
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_vendor\progress\__init__.p
y", line 120, in next
self.update()
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_vendor\progress\bar.py", l
ine 83, in update
self.writeln(line)
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_vendor\progress\__init__.p
y", line 100, in writeln
if self.file and self.is_tty():
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_vendor\progress\__init__.p
y", line 112, in is_tty
return self.file.isatty() if self.check_tty else True
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\cli\progress_bars
.py", line 200, in <lambda>
self.file.isatty = lambda: self.file.wrapped.isatty()
AttributeError: 'NoneType' object has no attribute 'isatty'
WARNING: You are using pip version 20.2; however, version 20.2.2 is available.
You should consider upgrading via the 'C:\Users\Lenovo\AppData\Local\Programs\Python\Python38\
python.exe -m pip install --upgrade pip' command.
Everytime I try to install anything with pip this error tends to show up. I tried to reinstall pip with get-pip.py from https://bootstrap.pypa.io/get-pip.py even for this I get the same error.
I am running python 3.8.5 and pip 20.2.

Cannot create python virtualenv

I'm working on a legacy app that needs python2.6.2.
I installed successfully python 2.6.2 and setuptools.
Now when I try to create a virtualenv using this version it gives me this error:
$ virtualenv --python=/usr/local/python2.6.2/bin/python mypythonnewapp
Running virtualenv with interpreter /usr/local/python2.6.2/bin/python
New python executable in /home/vagrant/mypythonnewapp/bin/python
Installing setuptools<37, pip, wheel<0.30...
Complete output from command /home/vagrant/mypythonnewapp/bin/python - setuptools<37 pip wheel<0.30:
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting setuptools<37
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/commands/install.py", line 324, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/requests/sessions.py", line 521, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/cachecontrol/adapter.py", line 37, in send
cached_response = self.controller.cached_request(request)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/cachecontrol/controller.py", line 111, in cached_request
resp = self.serializer.loads(request, cache_data)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/cachecontrol/serialize.py", line 114, in loads
return getattr(self, "_loads_v{0}".format(ver))(request, data)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/cachecontrol/serialize.py", line 196, in _loads_v2
return self.prepare_response(request, cached)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/cachecontrol/serialize.py", line 157, in prepare_response
**cached["response"]
TypeError: __init__() keywords must be strings
----------------------------------------
...Installing setuptools<37, pip, wheel<0.30...done.
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 2349, in <module>
main()
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 712, in main
symlink=options.symlink)
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 953, in create_environment
download=download,
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 904, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 796, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/vagrant/mypythonnewapp/bin/python - setuptools<37 pip wheel<0.30 failed with error code 2
Any suggestions other than upgrading anything are welcome.
Thanks
This seems like a bug in virtualenv. See how virtualenv.py limits versions of setuptools and wheel for Python 2.6, but not for pip. It must limit pip to version '<10' for Py 2.6. Please report the bug or better send a pull request.
Meanwhile create a virtualenv with --no-pip and later install pip into the virtualenv manually.
Try using pyenv. At least it claims to support versions of Python back to 2.1.3

Cannot create Virtualenv in Python

I'm struggling with virtualenv in Python.
After virtualenv _env I get:
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/marcin/Documents/Projects/django_tutorial/_env/bin/python2
Also creating executable in /home/marcin/Documents/Projects/django_tutorial/_env/bin/python
Installing setuptools, pkg_resources, pip, wheel...
Complete output from command /home/marcin/Documen...ial/_env/bin/python2 - setuptools pkg_resources pip wheel:
Collecting setuptools
Downloading setuptools-38.4.0-py2.py3-none-any.whl (489kB)
Exception:
Traceback (most recent call last):
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 821, in unpack_url
hashes=hashes
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 659, in unpack_http_url
hashes)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/utils/hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 571, in written_chunks
for chunk in chunks:
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/utils/ui.py", line 139, in iter
for x in it:
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 560, in resp_read
decode_content=False):
File "/home/marcin/Documents/Projects/django_tutorial/_env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/response.py", line 432, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/home/marcin/Documents/Projects/django_tutorial/_env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/response.py", line 397, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/home/marcin/Documents/Projects/django_tutorial/_env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/response.py", line 312, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.
----------------------------------------
...Installing setuptools, pkg_resources, pip, wheel...done.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 2375, in <module>
main()
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 724, in main
symlink=options.symlink)
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 992, in create_environment
download=download,
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 922, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 817, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/marcin/Documen...ial/_env/bin/python2 - setuptools pkg_resources pip wheel failed with error code 2
I've got:
virtualenv 15.1.0
pip 9.0.1
Python 2.7.13
I'm out of ideas. I tried exporting locales, reinstalling pip, setuptools and virtualenv.
Do you have any suggestions? I will be grateful.
If you are in China, you can change your pip source to solve this issue.
mkdir ~/.pip
echo '[global]' > ~/.pip/pip.conf
echo 'index-url = https://pypi.tuna.tsinghua.edu.cn/simple' >> ~/.pip/pip.conf
By using the mirror of Tsinghua University, you might solve your problem.

Unable to upgrade Scipy using PIP

I try to upgrade Scipy using PIP on Ubuntu 16.04 but always receive this error. I'm not sure what is going on. The progress reaches 99% and then stops, and spits out this error.
I've tried upgrading pip but the same error still occurs.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 310, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 750, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 370, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 587, in _prepare_file
session=self.session, hashes=hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 810, in unpack_url
hashes=hashes
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 649, in unpack_http_url
hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 871, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 595, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "/usr/local/lib/python2.7/dist-packages/pip/utils/hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 563, in written_chunks
for chunk in chunks:
File "/usr/local/lib/python2.7/dist-packages/pip/utils/ui.py", line 139, in iter
for x in it:
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 552, in resp_read
decode_content=False):
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/response.py", line 353, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/response.py", line 310, in read
data = self._fp.read(amt)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/filewrapper.py", line 54, in read
self.__callback(self.__buf.getvalue())
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/controller.py", line 275, in cache_response
self.serializer.dumps(request, response, body=body),
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/serialize.py", line 87, in dumps
).encode("utf8"),
MemoryError
Try to disable the cache during install using
pip install --no-cache-dir packageName
where packageName is scipy in this case
The last line says "MemoryError"
Are you using a virtual environment?
If so, the environment probably requires more memory to be allocated to it.
Go to Player > Manage > Virtual Machine Settings
Here, drag the slider to choose a higher value of memory to be allocated.
Restart the virtual environment for the changes to take place.
I hope this helps!

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