Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is PIP raising an AssertionError on pip freeze?

Tags:

pip

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?

like image 884
Luis Masuelli Avatar asked Dec 30 '14 19:12

Luis Masuelli


People also ask

Does pip freeze show dependencies?

Since pip freeze shows all dependencies as a flat list, finding out which are the top level packages and which packages do they depend on requires some effort. It's also tedious to resolve conflicting dependencies that could have been installed because older version of pip didn't have true dependency resolution [1].

What pip freeze does?

pip freeze is a very useful command, because it tells you which modules you've installed with pip install and the versions of these modules that you are currently have installed on your computer. In Python, there's a lot of things that may be incompatible, such as certain modules being incompatible with other modules.

What is the difference between pip freeze and pip list?

Therefore, you should use pip list and pip freeze as follows: If you want to check a list of packages with various conditions, use pip list . If you want to create requirements. txt , use pip freeze .


1 Answers

This worked for me (running Ubuntu, both 12 and 14 LTS):

pip install -U setuptools pip install -U pip 

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.

like image 103
knickum Avatar answered Oct 10 '22 15:10

knickum



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!