我试图创建一个虚拟环境,但是当我尝试激活它时,出现以下错误:
virtualenv hello
-bash: /usr/local/bin/virtualenv: /usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/Resour: bad interpreter: No such file or directory
对于可能出错的原因,您有什么想法吗?我的$PATH如下:
Users/me/workspace/google-cloud-sdk/bin:/usr/local/bin:/Users/me/workspace/google-cloud-sdk/bin:/urs/local/bin:/Users/me/workspace/google-cloud-sdk/bin:/urs/local/bin:/Users/me/workspace/google-cloud-sdk/bin:usr/local/python:usr/bin/python:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin: No such file or directory
事实上,返回错误信息让我怀疑我已经以某种方式设置了我的 .bash_profile 文件。这些是我所做的唯一修改:
#Set architecture flags
export ARCHFLAGS="-arch x86_64"
#Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
#Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc
# The next line updates PATH for the Google Cloud SDK.
source '/Users/me/workspace/google-cloud-sdk/path.bash.inc'
# The next line enables bash completion for gcloud.
source '/Users/me/workspace/google-cloud-sdk/completion.bash.inc'
这是我的 .bashrc 文件:
# pip should only run if there is a virtualenv currently activated
export PIP_REQUIRE_VIRTUALENV=true
# cache pip-installed packages to avoid re-downloading
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache