pip: Assertion Error with pip list
I experienced the following error after installing pip and attempting a: pip list --outdated
C:\Python33\Scripts\pip-script.py run on 07/27/13 15:32:54
Exception:
Traceback (most recent call last):
File "C:\Python33\lib\site-packages\pip\basecommand.py", line 134, in main
status = self.run(options, args)
File "C:\Python33\lib\site-packages\pip\commands\list.py", line 74, in run
self.run_outdated(options)
File "C:\Python33\lib\site-packages\pip\commands\list.py", line 83, in run_outdated
for dist, remote_version_raw, remote_version_parsed in self.find_packages_latests_versions(options):
File "C:\Python33\lib\site-packages\pip\commands\list.py", line 104, in find_packages_latests_versions
installed_packages = get_installed_distributions(local_only=options.local, include_editables=False, skip=self.skip)
File "C:\Python33\lib\site-packages\pip\util.py", line 384, in get_installed_distributions
return [d for d in pkg_resources.working_set
File "C:\Python33\lib\site-packages\pip\util.py", line 387, in <listcomp>
and editable_test(d)
File "C:\Python33\lib\site-packages\pip\util.py", line 377, in <lambda>
editable_test = lambda d: not dist_is_editable(d)
File "C:\Python33\lib\site-packages\pip\util.py", line 347, in dist_is_editable
req = FrozenRequirement.from_dist(dist, [])
File "C:\Python33\lib\site-packages\pip\__init__.py", line 194, in from_dist
assert len(specs) == 1 and specs[0][0] == '=='
AssertionError
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 42 (8 by maintainers)
Links to this issue
Commits related to this issue
- Remove check for PyMySQL from 00-setup pip doesn't actually do any network traffic if a module is already installed, so there's actually no point in doing the check ourselves. And it's currently brok... — committed to johnsca/charm-mysql by johnsca 8 years ago
- #1: Remove check for PyMySQL from 00-setup pip doesn't actually do any network traffic if a module is already installed, so there's actually no point in doing the check ourselves. And it's currentl... — committed to juju-solutions/charm-mysql by johnsca 8 years ago
The issue is still there in Ubuntu 15.04, pip 1.5.6, distribute-0.7.3 (the pip upgrade of ‘pip’ or ‘distribute’ does not work, as the issue seems to be Ubuntu specific. See below).
The fix it:
sudo apt-get remove --auto-remove python-pipwget https://bootstrap.pypa.io/get-pip.pysudo python get-pip.pysudo ln -s /usr/local/bin/pip /usr/bin/pipDone!
The issue logs:
I’ve installed
pipwithsudo apt-get install python-pip, but even with latestpip,distributeandsetuptoolsI still hadAssertionErrorwhen usingpip listorpip freezein Ubuntu 14.10. Commandsudo apt-get install python-pipalso installs dependencies:python-colorama,python-distlib,python-html5lib,python-requestsandpython-wheel. I think some of these modules are giving meAssertionError, so I’ve uninstalledpipwith all dependencies withsudo apt-get remove --auto-remove python-pip, and then justpipwithsudo easy_install pip. Only this way works for me.It happens when you install distribute using
http://python-distribute.org/distribute_setup.pyscript. Runningpip install -U distributefixes the problem. The bug reproduces only inpip==1.4. Here’s why this line fails:I follow @arktrin 's comment and this is solved. the below is the log.