当我运行workon env1
时,
-bash: /usr/local/bin/python: No such file or directory
-bash: /usr/local/bin/python: No such file or directory
显示(同一行两次)。但是,我在env1中,因为它出现在我的命令提示符中。当我运行which virtualenvwrapper.sh
时,我得到了
/Library/Frameworks/Python.framework/Versions/3.4/bin/virtualenvwrapper.sh
我看到另一个说要运行ln -s /Library/Frameworks/Python.framework/Versions/3.4/bin/virtualenvwrapper.sh /usr/local/bin/virtualenvwrapper.sh
的帖子给了我
ln: /usr/local/bin/virtualenvwrapper.sh: File exists
我通过sudo -H pip install virtualenvwrapper
不确定从哪里开始。
答案 0 :(得分:1)
对我来说,/usr/local/bin
与python2
之间有一个链接。我创建了另一个,将同一个文件链接到python
。
$ cd /usr/local/bin
# The /usr/local/bin/python2 symlink exists already.
$ ls -al python2
lrwxr-xr-x 1 a_user a_group 37 Jul 26 09:54 /usr/local/bin/python2 -> ../Cellar/python/2.7.13_1/bin/python2
# Make a symlink for python. The path for the python2
# symlink on your system might be different from this
# example. Just use whatever path the python2 symlink
# is pointing to on your system.
$ ln -s ../Cellar/python/2.7.13_1/bin/python2 python
# Now the symlink exists at /usr/local/bin/python
$ ls -al python
lrwxr-xr-x 1 a_user a_group 37 Jul 26 14:29 python -> ../Cellar/python/2.7.13_1/bin/python2*