Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assertion error from 'pip list' in virtualenv.

Pip list is throwing an Assertion error and I'm not sure how to resolve. This has just happened after building 2 packages (PyUblas-2013.1 and boost_1_54_0) from source. I am using virtualenv.

Error below;

(virtenv)[user@xyz ~]$ pip list
beautifulsoup4 (4.2.1)
biopython (1.61)
distribute (0.6.35)
methylpy (0.1.0)
MySQL-python (1.2.4)
numpy (1.7.1)
pip (1.4)
py (1.4.15)
pytest (2.3.5)
PyUblas (2013.1)
Exception:
Traceback (most recent call last):
  File "/home/user/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 134, in main
    status = self.run(options, args)
  File "/home/user/virtenv/lib/python2.7/site-packages/pip/commands/list.py", line 80, in run
    self.run_listing(options)
  File "/home/user/virtenv/lib/python2.7/site-packages/pip/commands/list.py", line 127, in run_listing
    self.output_package_listing(installed_packages)
  File "/home/user/virtenv/lib/python2.7/site-packages/pip/commands/list.py", line 136, in output_package_listing
    if dist_is_editable(dist):
  File "/home/user/virtenv/lib/python2.7/site-packages/pip/util.py", line 347, in dist_is_editable
    req = FrozenRequirement.from_dist(dist, [])
  File "/home/user/virtenv/lib/python2.7/site-packages/pip/__init__.py", line 194, in from_dist
    assert len(specs) == 1 and specs[0][0] == '=='
AssertionError

Can anyone help me troubleshoot???

Thanks,

like image 654
user1995839 Avatar asked Aug 09 '13 02:08

user1995839


3 Answers

I think it is because the distribute package is out of date. Certainly the following fixed it for me:

pip install --upgrade distribute
like image 159
Timothy Corbett-Clark Avatar answered Nov 20 '22 15:11

Timothy Corbett-Clark


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.

pip --version # 1.5.4
curl -O https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
pip --version # 6.0.8

https://pip.pypa.io/en/latest/installing.html

like image 25
wisbucky Avatar answered Nov 20 '22 14:11

wisbucky


I know it's old but since I had the same problem and the fix didn't helped. Guess does not harm adding my solution.

Just updated pip, from inside of my virtualenv.

pip install --upgrade pip
like image 26
ademarizu Avatar answered Nov 20 '22 15:11

ademarizu