Cant install pip modules - python

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.

Related

Unable to upgrade pip and requests modules

I'm unable to upgrade pip from version 20.0.2 which comes default with the venv to the latest version of pip which is 20.2.
I've tried the following using Python 3.8.5:
$ python3 -m venv venv
$ source venv/bin/activate // in the venv now
$ pip install -U pip
And I get the following stack trace:
ERROR: Exception:
Traceback (most recent call last):
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
status = self.run(options, args)
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 357, in run
resolver.resolve(requirement_set)
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/legacy_resolve.py", line 270, in _get_abstract_dist_for
skip_reason = self._check_skip_installed(req)
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/legacy_resolve.py", line 246, in _check_skip_installed
self.finder.find_requirement(req_to_install, upgrade=True)
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 898, in find_requirement
best_candidate_result = self.find_best_candidate(
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 881, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 825, in find_all_candidates
package_links = self.process_project_url(
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 790, in process_project_url
html_page = self._link_collector.fetch_page(project_url)
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/index/collector.py", line 497, in fetch_page
return _get_html_page(location, session=self.session)
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/index/collector.py", line 337, in _get_html_page
resp = _get_html_response(url, session=session)
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/index/collector.py", line 126, in _get_html_response
resp = session.get(
File "/home/justin/Desktop/venv/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/home/justin/Desktop/venv/lib/python3.8/site-packages/pip/_internal/network/session.py", line 405, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/home/justin/Desktop/venv/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/home/justin/Desktop/venv/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/home/justin/Desktop/venv/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/adapter.py", line 51, in send
request.headers.update(self.controller.conditional_headers(request))
File "/home/justin/Desktop/venv/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/controller.py", line 233, in conditional_headers
resp = self.serializer.loads(request, self.cache.get(cache_url))
File "/home/justin/Desktop/venv/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/serialize.py", line 97, in loads
return getattr(self, "_loads_v{}".format(ver))(request, data)
File "/home/justin/Desktop/venv/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/serialize.py", line 188, in _loads_v4
return self.prepare_response(request, cached)
File "/home/justin/Desktop/venv/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/serialize.py", line 140, in prepare_response
return HTTPResponse(body=body, preload_content=False, **cached["response"])
TypeError: __init__() got an unexpected keyword argument 'filter_status'
Same thing happens when I try to run $ pip install requests.
Any one have any ideas what might be the problem?
Seems pip had troubles with whatever was in my cache
Running this worked (for example):
$ pip install requests --no-cache-dir

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

Encoding error when attempt to install matplotlib on ubuntu

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

pip or setuptools not working in python 3

I am using python 3 with Archlinux. Whenever I want to use pip to install packages, most packages fail to install and report the same problem:
Exception:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3.4/site-packages/pip/commands/install.py", line 339, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python3.4/site-packages/pip/req/req_set.py", line 229, in prepare_files
req_to_install.check_if_exists()
File "/usr/lib/python3.4/site-packages/pip/req/req_install.py", line 928, check_if_exists
self.satisfied_by = pkg_resources.get_distribution(self.req)
File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 461, in get_distribution
dist = get_provider(dist)
File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 341, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 870, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 740, in resolve
env = Environment(self.entries)
File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 927, in __init__
self.scan(search_path)
File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 957, in scan
self.add(dist)
File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 977, in add
dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
TypeError: unorderable types: NoneType() < str()
Is it a bug of pip or setuptools?

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