损坏的python文件

时间:2014-09-10 06:38:33

标签: python

错误地我损坏了python文件。

gauravv@ubuntu:~/Documents$ cp test.py /usr/local/bin/python
cp: cannot create regular file ‘/usr/local/bin/python’: Permission denied
gauravv@ubuntu:~/Documents$ sudo cp test.py /usr/local/bin/python
[sudo] password for gauravv: 
gauravv@ubuntu:~/Documents$

现在我收到此错误

gauravv@ubuntu:/usr/local/bin$ python
bash: /usr/local/bin/python: /usr/local/bin/python: bad interpreter: Too many levels of symbolic links
gauravv@ubuntu:/usr/local/bin$ 

无需安装即可恢复此文件的任何方法。

1 个答案:

答案 0 :(得分:1)

根据您的发行版/usr/local/bin/python可能只是实际二进制文件的链接,您肯定可以恢复。 您需要做的就是找到原始的二进制文件。查看/usr/bin等地方。

然后恢复链接: sudo ln -s /usr/bin/python /usr/local/bin/python