ubuntu/usr/bin/env:python:没有这样的文件或目录 [英] ubuntu /usr/bin/env: python: No such file or directory

查看:4052
本文介绍了ubuntu/usr/bin/env:python:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更新了内核,在Ubuntu无法正常工作之后,PS:我尝试执行"meld"命令,它将报告"/usr/bin/env:python:没有这样的文件或目录", 然后我执行"sudo apt-get install python"并得到结果"python已经是最新版本.",我该怎么办.

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.

我不擅长linux,能否告诉我如何将linux恢复到最近的状态,或者正常地重新安装python.

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.

推荐答案

我自己被这个错误暂时困扰,我想我应该发布解决问题的方式.

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

我的问题是一个错误:

: No such file or directory

这对我来说毫无意义.我的问题是我的编辑器已将脚本从Unix LF静默转换为Windows CR/LF行终止.一个相当不幸的结果是#!/usr/bin/env python"实际上变成了#!/usr/bin/env python \ 015",其中\ 015是不可见的CR字符.../usr/bin/因此,env无法找到命令"python \ 015"-因此,文件未找到错误.

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.

将脚本转换为Unix行尾约定可以解决我的问题...但是只需要花几分钟的时间.

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

这篇关于ubuntu/usr/bin/env:python:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆