-bash:/ usr / local / bin / python:没有这样的文件或目录

时间:2016-08-10 20:33:10

标签: bash python-3.4 virtualenvwrapper

当我运行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

安装了包装器

不确定从哪里开始。

1 个答案:

答案 0 :(得分:1)

对我来说,/usr/local/binpython2之间有一个链接。我创建了另一个,将同一个文件链接到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*