如何在/ usr / bin / python中重新安装目录 [英] How do I reinstall a directory in /usr/bin/python
问题描述
我想我在/ usr / bin / python中删除了我的目录,当我安装了python 3,因为我得到这个错误: -bash:/ usr / bin / python:没有这样的文件或目录。
sudo ln -s /usr/bin/python2.7 / usr / bin / python
,这让我 ln:/ usr / bin / python :文件存在
但是,它仍然不会在/ usr / bin / python中永久安装目录。如何永久恢复此目录?
我在一个mac。
谢谢! >
您的文件/ usr / bin / python存在,因为您收到以下消息:
ln:/ usr / bin / python:文件存在
但是我看到它是一个不存在的链接,因为您收到以下消息:
-bash :/ usr / bin / python:没有这样的文件或目录
是:
sudo rm / usr / bin / python#因为这是一个损坏的文件
sudo ln -s / usr /bin/python2.7 / usr / bin / python#如果你的文件/usr/bin/python2.7可以,这行将工作。
希望有帮助!
I have researched this for hours to no avail.
I think I deleted my directory at /usr/bin/python when I installed python 3 because I get this error: -bash: /usr/bin/python: No such file or directory.
I've tried sudo ln -s /usr/bin/python2.7 /usr/bin/python
, and that gives me ln: /usr/bin/python: File exists
However, it still doesn't permanently install a directory in /usr/bin/python. How do I permanently restore this directory?
I'm on a mac.
Thanks!
Your file /usr/bin/python exists because you get the message:
ln: /usr/bin/python: File exists
but I see that it is a corrupted link to something that doesn't exist, because you get the message:
-bash: /usr/bin/python: No such file or directory
What you have to do to fix that is:
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.
Hope that helps!
这篇关于如何在/ usr / bin / python中重新安装目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!