Python升级后Virtualenv不工作。怎么办?
我用python构建了一个小应用程序,一切都很顺利。之后,我决定用自制软件将python升级到2.7.5。当我回去开始一个新项目时,我不再能够创建虚拟环境。这就是我得到的错误:Python升级后Virtualenv不工作。怎么办?,python,django,virtualenv,homebrew,Python,Django,Virtualenv,Homebrew,我用python构建了一个小应用程序,一切都很顺利。之后,我决定用自制软件将python升级到2.7.5。当我回去开始一个新项目时,我不再能够创建虚拟环境。这就是我得到的错误: virtualenv --no-site-packages club_envNew python executable in club_env/bin/python ERROR: The executable club_env/bin/python is not functioning ERROR: It thinks
virtualenv --no-site-packages club_envNew python executable in club_env/bin/python
ERROR: The executable club_env/bin/python is not functioning
ERROR: It thinks sys.prefix is u'/System/Library/Frameworks/Python.framework/Versions/2.7' (should be u'/Users/myusername/Code/python/club/club_env')
ERROR: virtualenv is not compatible with this system or executable
有人能解释一下吗
我注意到您没有提到从哪个python升级而来,但我对您的问题做出了最好的猜测:
您需要在新的
Python 2.7.5
默认环境中重新安装`virtualenv
,然后才能再次创建新的虚拟环境。您是从virtualenv创建virtualenv的吗?我需要先清除当前的virtualenv安装吗?当我重新安装时,它只会告诉我“需求已经满足”,如果是这样的话,我怎么才能找到我需要在哪里执行-清除?所以我在virtualenv上运行了-帮助,它说,“要使用的Python解释器,例如--Python=python2.5将使用python2.5解释器来创建新环境。默认值是安装virtualenv时附带的解释器(/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python)“。这不意味着它已经在使用2.7版本的解释器了吗?@Jordy当我安装virtualenv
时,我通常在虚拟环境中使用我想要的Python版本。这样,在新环境中使用哪种Python是毫无疑问的。