My console:
desarrollador@desarrollador-HP-14-Notebook-PC1:~$ pip freeze
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/freeze.py", line 68, in run
req = pip.FrozenRequirement.from_dist(dist, dependency_links, find_tags=find_tags)
File "/usr/lib/python2.7/dist-packages/pip/init.py", line 156, in from_dist
assert len(specs) == 1 and specs[0][0] == '=='
AssertionError
I installed the tornado package and this happened since. How can I fix it?
It may be a bit late, but one thing I found was there are 2 or three versions of pip installed (depending on what you installed)
pip - the OS version installed, freeze doesn't work and it can be out of date pip2 - the newer one installed but upgrading pip via pip etc pip3 - installed if you have python3 and python2 installed at the same time.
You can either change which pip gets used in $PATH, or do what I did:
pip2 freeze (which does work on ubuntu14 if you have more than one option for python)
Reason: The python-pip package in Ubuntu 12.04 is seriously outdated and has some bugs with certain package names (as I can see) and cannot parse them correctly.
Solution: install a newer version of pip, via easy_install.
First, I ran Martin Mohan's solution:
Then, boredcoding's ultimately fixed the problem, both solutions are found near bottom of thread: I screwed up the system version of Python Pip on Ubuntu 12.10
The logic behind these two fix are stated in the thread (linked above), so I will refrain from going into each here.
I found the solution at this link.
pip install setuptools==7.0
Your pip may be outdated. Even in Ubuntu 14.04 LTS, the pip version it installed using
apt-get install python-pip
was 1.5.4. Try updating pip manually, and possibly the new packages again as well.https://pip.pypa.io/en/latest/installing.html
This worked for me (running Ubuntu, both 12 and 14 LTS):
Upgrade to the latest version of setuptools in order to be able to upgrade to the latest version of pip, and upgrade to the latest version of pip to get a version that has fixed the AssertException error.