【问题标题】:zsh: /usr/local/bin/youtube-dl: bad interpreter: /usr/local/opt/python/bin/python2.7: no such file or directoryzsh:/usr/local/bin/youtube-dl:错误的解释器:/usr/local/opt/python/bin/python2.7:没有这样的文件或目录
【发布时间】:2018-09-25 00:43:29
【问题描述】:

macOS 10.12

似乎是同一个问题here,但最重要的答案只会引发更多问题。

Top answer 说要做:

brew link --overwrite python

产生:

Warning: Already linked: /usr/local/Cellar/python/3.6.5
To relink: brew unlink python && brew link python

我很确定我需要自制软件才能切换到 2.7,而不是使用版本 3。我愿意

brew unlink python && brew link python

然后得到:

Unlinking /usr/local/Cellar/python/3.6.5... 25 symlinks removed
Linking /usr/local/Cellar/python/3.6.5... 25 symlinks created

有没有办法让它链接到特定版本? /usr/local/Cellar/python/ 包含:2.7.13 2.7.14 2.7.14_3 3.6.3 3.6.5

如何让我的系统始终使用2.7.14_3?

/usr/local/opt/python/bin 包含 python3、python3-config 和 3.6 版本。我怎样才能在此处获取 2.7 并删除 3 和 3.6?

同样which python 返回/usr/bin/python。当我输入python -V 时,我得到Python 2.7.10。 /usr/bin 包含 python2.7、python2.7-config 以及其他一些看似与 python 相关的东西(但没有 python3,我认为这很好)。这与自制蟒蛇有什么不同吗?提前致谢。

编辑:

Second-to-top answer 说要执行head -n1 /usr/local/bin/pip,它返回

head: /usr/local/bin/pip: No such file or directory

和

mv /usr/local/bin/pip /usr/local/bin/pip.old

返回

mv: rename /usr/local/bin/pip to /usr/local/bin/pip.old: No such file or directory

【问题讨论】:

    标签: python python-3.x macos python-2.7 youtube-dl


    【解决方案1】:
    1. brew uninstall --ignore-dependencies python(你可能不想--ignore dependencies,这取决于你可能破坏的其他东西,即numpy、opencv)

    2. brew install python@2see here

    3. brew uninstall youtube-dl

    4. brew install youtube-dl

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-24
      • 2014-10-24
      • 2020-05-03
      • 2020-12-01
      • 1970-01-01
      • 2023-04-04
      相关资源
      最近更新 更多