Delete all virtualenv and start from scratch

前提是你 提交于 2019-12-23 04:44:47

问题


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

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 `('

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

How can I delete all virtualenv, and start from scratch?


回答1:


After uninstalling everything and removing all the virtualenv, I was able to successfully install. Just incase if you have

~/.pydistutils.cfg

You might want to follow instructions in: https://github.com/mxcl/homebrew/issues/12667#issuecomment-6257342



来源:https://stackoverflow.com/questions/19348077/delete-all-virtualenv-and-start-from-scratch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!