启动终端时出现此错误:
Last login: Thu Apr 9 19:49:08 on ttys001
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/2.7/bin/python and that PATH is
set properly.
dhcp-128-189-78-23:~ user_me$
我需要将我的虚拟环境“指向”我正在使用的python版本。
我该怎么做?
在virtualenvwrapper install guide中找到了以下内容。您可以尝试设置正确的$PATH。
要重写$PATH搜索,请将变量VIRTUALENVWRAPPER_PYTHON设置为要使用的解释器的完整路径,并将VIRTUALENVWRAPPER_VIRTUALENV设置为要使用的VIRTUALENV二进制文件的完整路径。两个变量都必须在获取virtualenvwrapper.sh之前设置。例如:
我也遇到了同样的问题,更新路径没有任何帮助,也没有设置VIRTUALENVWRAPPER_PYTHON和VIRTUALENVWRAPPER_VIRTUALENV。这是因为我在运行我的python版本时看到了这种奇怪的行为:
我可以通过使用brew卸载python、使用brew重新安装python并强制它覆盖/usr/local/bin中的现有符号链接来修复所有问题。
希望你在六个月前遇到这个问题的时候能够克服它。我想发布我的解决方案,以防其他人遇到相同的问题,无法通过设置路径和env变量来解决。
相关问题 更多 >
编程相关推荐