删除所有virtualenv并从头开始 [英] Delete all virtualenv and start from scratch
问题描述
我曾经使用macport,最近又改用自制软件.在使用homebrew安装的python版本清理了所有macports环境后,我进行了pip install virtualenv的安装.
I used to use macport and recently switch to homebrew. After cleaning up all the macports enviornments using python version installed by homebrew I did 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,看到它有点困惑
I also check what virtualenv are available in the system, it was bit confusing to see
$virtualenv
virtualenv virtualenv-2.6
因此,我卸载了已安装的内容,然后尝试重新安装:
SO I uninstall what I installed and then tried to do a reinstall:
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是符号链接:
I checked how the structure looks like in /usr/local/bin: I don't think any of these virtualenv(s) are symlinks:
-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,并从头开始?
How can I delete all virtualenv, and start from scratch?
推荐答案
在卸载所有内容并删除了所有virtualenv之后,我能够成功安装.万一您有
After uninstalling everything and removing all the virtualenv, I was able to successfully install. Just incase if you have
~/.pydistutils.cfg
您可能要按照以下说明进行操作: https://github.com/mxcl/homebrew/issues/12667#issuecomment-6257342
You might want to follow instructions in: https://github.com/mxcl/homebrew/issues/12667#issuecomment-6257342
这篇关于删除所有virtualenv并从头开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!