ubuntu /usr/bin/env: python: No such file or directory

落爺英雄遲暮 提交于 2019-11-29 02:35:40

问题


I update the kernel, after that the Ubuntu doesn't work well, PS: I try to exec "meld" command, it will report that "/usr/bin/env: python: No such file or directory", then I exec "sudo apt-get install python" and get the result "python is already the newest version.", what should I do for it.


I'm not good at linux, can you tell me how to revert my linux to the last right status, or reinstall the python normally.


回答1:


Having been momentarily stumped by this error myself, I thought I'd post how I fixed my problem.

My problem was an error:

: No such file or directory

Which made little sense to me. My problem is that my editor had silently converted the script from Unix LF to Windows CR/LF line-termination. A rather unfortunate upshot of this is that "#!/usr/bin/env python" actually became "#!/usr/bin/env python\015" where \015 is the invisible CR character... /usr/bin/env was, then, unable to find a command "python\015" - hence the file-not-found error.

Converting the script to Unix line-ending convention solved my problem... but only after a few minutes' head-scratching.



来源:https://stackoverflow.com/questions/3655306/ubuntu-usr-bin-env-python-no-such-file-or-directory

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