【问题标题】:How do I reinstall a directory in /usr/bin/python [closed]如何在 /usr/bin/python 中重新安装目录 [关闭]
【发布时间】:2013-03-06 00:32:33
【问题描述】:

我研究了好几个小时都没有用。

我想我在安装 python 3 时删除了 /usr/bin/python 中的目录,因为我收到此错误:-bash: /usr/bin/python: No such file or directory.

我尝试过sudo ln -s /usr/bin/python2.7 /usr/bin/python,这给了我ln: /usr/bin/python: File exists

但是,它仍然不会在 /usr/bin/python 中永久安装目录。如何永久恢复此目录?

我在 Mac 上。

谢谢!

【问题讨论】:

  • /usr/bin/python 应该是一个文件,而不是一个目录。运行ls -l /usr/bin/python 输出什么?
  • 你可能删除了python使用的库,而不是python本身。

标签: python directory installation bin


【解决方案1】:

您的文件 /usr/bin/python 存在,因为您收到消息:

ln: /usr/bin/python: File exists

但我发现它是指向不存在的东西的损坏链接,因为您收到了以下消息:

-bash: /usr/bin/python: No such file or directory

你必须做的是解决这个问题:

sudo rm /usr/bin/python    # because that's a corrupted file
sudo ln -s /usr/bin/python2.7 /usr/bin/python    # this line will work if your file /usr/bin/python2.7 is OK.

希望有帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-03
    • 1970-01-01
    • 1970-01-01
    • 2019-11-20
    • 2017-02-17
    • 1970-01-01
    相关资源
    最近更新 更多