【问题标题】:-bash: /usr/local/bin/python: No such file or directory-bash: /usr/local/bin/python: 没有这样的文件或目录
【发布时间】:2016-08-10 20:33:10
【问题描述】:

当我运行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安装了包装器

不确定从这里去哪里。

【问题讨论】:

    标签: bash python-3.4 virtualenvwrapper


    【解决方案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*
    

    【讨论】:

    • 修复方法与 Python 3 相同。只需使用 /usr/local/bin/python3 符号链接作为路径源即可。
    猜你喜欢
    • 2016-05-03
    • 1970-01-01
    • 2018-03-21
    • 2023-04-04
    • 1970-01-01
    • 1970-01-01
    • 2014-10-24
    • 1970-01-01
    • 2019-07-25
    相关资源
    最近更新 更多