删除所有virtualenv并从头开始

时间:2013-10-13 17:24:54

标签: python virtualenv homebrew

我以前使用macport,最近切换到自制软件。使用自制软件安装的python版本清理完所有的macports环境后,我做了pip install virtualenv。

$virtualenv test --no-site-packages
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: virtualenv==1.9.1

我还检查了系统中可用的virtualenv,看到

有点令人困惑
$virtualenv
virtualenv      virtualenv-2.6  

所以我卸载了我安装的内容,然后尝试重新安装:

Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/site-packages
-bash: syntax error near unexpected token `('

我检查了/ usr / local / bin中结构的样子:我不认为这些virtualenv中的任何一个都是符号链接:

-rwxr-xr-x    1 root  wheel       276 Mar 12  2013 virtualenv
-rwxr-xr-x    1 root  wheel       284 Mar 12  2013 virtualenv-2.6

如何删除所有virtualenv,并从头开始?

1 个答案:

答案 0 :(得分:0)

卸载所有内容并删除所有virtualenv后,我能够成功安装。只要你有

~/.pydistutils.cfg

您可能需要按照以下说明操作: https://github.com/mxcl/homebrew/issues/12667#issuecomment-6257342