How do I reinstall a directory in /usr/bin/python [closed]

坚强是说给别人听的谎言 提交于 2020-01-13 09:40:07

问题


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!


回答1:


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!



来源:https://stackoverflow.com/questions/15236832/how-do-i-reinstall-a-directory-in-usr-bin-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!