Assertion Error with pip list
See original GitHub issueI 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
Issue Analytics
- State:
- Created 10 years ago
- Comments:42 (8 by maintainers)
Top Results From Across the Web
Pip list crashes with an AssertionError - python - Stack Overflow
The problem, as I understand it, is that pip as provided by Ubuntu is old, and also cannot update itself (since it's managed...
Read more >Fixing an assertion error on pip list
The blog post describes how to fix an assertion error when trying to list Python packages with the 'pip list' command.
Read more >Python | Assertion Error - GeeksforGeeks
Assertion is a programming concept used while writing a code where the user declares a condition to be true using assert statement prior...
Read more >Changelog - pip documentation v22.3.1
This fixes an AssertionError that occurred when determining installation order, for a very specific combination of upgrading-already-installed-package + ...
Read more >Python's assert: Debug and Test Your Code Like a Pro
If the condition of an assert statement evaluates to false, then assert raises an AssertionError . If you provide the optional assertion message ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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-pip
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo ln -s /usr/local/bin/pip /usr/bin/pip
Done!
The issue logs:
I’ve installed
pip
withsudo apt-get install python-pip
, but even with latestpip
,distribute
andsetuptools
I still hadAssertionError
when usingpip list
orpip freeze
in Ubuntu 14.10. Commandsudo apt-get install python-pip
also installs dependencies:python-colorama
,python-distlib
,python-html5lib
,python-requests
andpython-wheel
. I think some of these modules are giving meAssertionError
, so I’ve uninstalledpip
with all dependencies withsudo apt-get remove --auto-remove python-pip
, and then justpip
withsudo easy_install pip
. Only this way works for me.