简体   繁体   English

python ubuntu virtualenv - >错误

[英]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: 而Ubuntu 10.10就像:

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? 是什么赋予了?

Had the same issue after upgrading to Ubuntu 11.04.. 升级到Ubuntu 11.04之后有同样的问题..

Turns out it was only because apt installed python-virtualenv 1.4, which was too old. 事实证明这只是因为安装了python-virtualenv 1.4,这太旧了。

I removed the deb package and used pip install instead and it worked fine. 我删除了deb包并使用了pip install而且工作正常。

pip install virtualenv

The python-virtualenv package should have installed virtualenv in /usr/bin/ . python-virtualenv包应该在/usr/bin/安装了virtualenv

Instead, the traceback error message says you are running /usr/local/bin/virtualenv . 相反,回溯错误消息表明您正在运行/usr/local/bin/virtualenv Perhaps uninstall the /usr/local version of virtualenv , and try again. 也许卸载virtualenv/usr/local版本,然后再试一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM