Linux /usr/bin/env: python2: 没有那个文件或目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11390206/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
/usr/bin/env: python2: No such file or directory
提问by murtaza52
I am trying to configure Python for my Emacs on Ubuntu, and I get the following error:
我正在尝试在 Ubuntu 上为我的 Emacs 配置 Python,但出现以下错误:
/usr/bin/env: python2: No such file or directory
Can someone help me with it? What can I do to resolve it?
有人可以帮我吗?我能做些什么来解决它?
采纳答案by glglgl
Probably that's just true. The link /usr/bin/python2 -> (the real one)
should be provided by your Python package, but that's obviously not the case, nor on any other location where it can be found via the $PATH
.
大概就是这样吧。该链接/usr/bin/python2 -> (the real one)
应该由您的 Python 包提供,但显然不是这种情况,也不是可以通过$PATH
.
You should put the said link in your path at the (an) appropriate place.
您应该将上述链接放在您的路径中(一个)适当的位置。
回答by ParaMeterz
Try this command in terminal
在终端中试试这个命令
sudo ln -s /usr/bin/python2.6 /usr/bin/python2
须藤 ln -s /usr/bin/python2.6 /usr/bin/python2
or
或者
sudo apt-get install python2
须藤 apt-get 安装 python2
回答by jfs
On Ubuntu 12.04.
在 Ubuntu 12.04 上。
To find out what package owns the file:
要找出哪个包拥有该文件:
$ apt-file -F find /usr/bin/python2
python-minimal: /usr/bin/python2
To find out what packages depend on the package:
要找出依赖包的包:
$ apt-cache rdepends python-minimal
python-minimal
Reverse Depends:
python2.7-minimal
|livecd-rootfs
python-minimal:i386
python-support
python2.7-minimal
python
|livecd-rootfs
It show that if you have python
package then you should have python-minimal
package then you should have /usr/bin/python2
file.
它表明,如果你有python
包,那么你应该有python-minimal
包,那么你应该有/usr/bin/python2
文件。
Check whether /usr/bin
is in $PATH
inside emacs. If it is and you can't run /usr/bin/python2
from a shell then you could reinstall python-minimal
to restore /usr/bin/python2
file:
检查是否/usr/bin
在$PATH
emacs里面。如果是这样并且您无法/usr/bin/python2
从 shell运行,那么您可以重新安装python-minimal
以恢复/usr/bin/python2
文件:
$ sudo apt-get --reinstall install python-minimal