Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python ubuntu virtualenv -> error

Newbie here, be kind.

The other day I am all:

sudo apt-get install python-virtualenv

And then I am (following instructions):

virtualenv env

And Ubuntu 10.10 is like:

Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2675, in <module>
    parse_requirements(__requires__), Environment()
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 552, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: virtualenv==1.5.1

What gives?

like image 417
John Lawrence Aspden Avatar asked Feb 21 '11 21:02

John Lawrence Aspden


2 Answers

Had the same issue after upgrading to Ubuntu 11.04..

Turns out it was only because apt installed python-virtualenv 1.4, which was too old.

I removed the deb package and used pip install instead and it worked fine.

pip install virtualenv
like image 127
h3. Avatar answered Sep 19 '22 23:09

h3.


The python-virtualenv package should have installed virtualenv in /usr/bin/.

Instead, the traceback error message says you are running /usr/local/bin/virtualenv. Perhaps uninstall the /usr/local version of virtualenv, and try again.

like image 27
unutbu Avatar answered Sep 20 '22 23:09

unutbu