-bash: /usr/bin/yum: /usr/bin/python2.6.62.6.6: bad interpreter: No such file or directory
来源:互联网 发布:mac php开发环境 编辑:程序博客网 时间:2024/06/07 04:46
-bash: /usr/bin/yum: /usr/bin/python2.6.62.6.6: bad interpreter: No such file or directory
错误很简单 找不到python2.6.62.6.6文件夹,原因是安装其他软件导致python版本和yum配置里到pyhon版本不一致,所以yum找不到pyhon执行文件。
解决方法:进入到 /usr/bin 文件夹下 看看当前的python执行文件名 然后把/usr/bin/yum 首行改为相应文件名
[root@host bin]# cd /usr/bin
[root@host bin]# ls -al | grep python
lrwxrwxrwx 1 root root 24 Oct 12 10:05 python -> /usr/local/bin/python2.7
lrwxrwxrwx 1 root root 6 Oct 12 09:57 python2 -> python
-rwxr-xr-x 1 root root 4864 Aug 18 2016 python2.6
lrwxrwxrwx 1 root root 24 Oct 12 10:00 python2.6.6 -> /usr/local/bin/python2.7
vi /usr/bin/yum 后改如下首行
#!/usr/bin/python2.6.6
import sys
try:
import yum
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
%s
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
%s
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
然而 ,还不可以,输入yum 显示倒入 一个python模块出错,原因是当前yum 的python执行版本太高。上面看到我还有2.6的python版本。因此将 /usr/bin/yum py文件的首行改成低版本的pyhon(2.6)即可
[root@host bin]# yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
No module named yum
Please install a package which provides this module, or
verify that the module is installed correctly.
- -bash: /usr/bin/yum: /usr/bin/python2.6.62.6.6: bad interpreter: No such file or directory
- -bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory
- -bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory
- -bash: /usr/bin/autocrorder: /usr/bin/python^M: bad interpreter: No such file or directory
- bash: /usr/bin/autocrorder: /usr/bin/python^M: bad interpreter: No such file or directory
- bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or direct
- -bash: /usr/bin/fap: /bin/bash^M: bad interpreter: No such file or directory
- /usr/bin/expect: bad interpreter: No such file or directory
- bash: /usr/bin/php^M: bad interpreter: No such file or directory
- -bash: ./****.py: /usr/bin/python^M: bad interpreter: No such file or directory
- -bash: ./cli: /usr/bin/php^M: bad interpreter: No such file or directory
- -bash: /usr/bin/python^M: bad interpreter: No such file or directory
- [Linux vim问题解决] -bash: ./script.sh: /usr/bin/bash^M: bad interpreter: No such file or directory
- 在安装VMware-tools出现bash:./vmware-install.pl :/usr/bin/perl:bad interpreter:No such file or directory.
- bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter:No such file or directory
- bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter:No such file or directory
- /usr/bin/perl:bad interpreter :no file or directory
- /usr/bin/perl^M: bad interpreter: No such file or directory
- 【算法分析与设计】【第七周】200 & 695. Number(Max Area) of Islands
- 对js函数作用域的进一步理解
- html中contentEditable属性
- 磁盘与文件系统管理--鸟哥私房菜读书笔记
- 函数的相关知识
- -bash: /usr/bin/yum: /usr/bin/python2.6.62.6.6: bad interpreter: No such file or directory
- linux后台查看共享内存和消息队列的命令
- 【常见排序算法】以最简单的方式理解归并排序
- 计算机视觉中的学习资料
- java集合类
- servlet-api.jar,发布到tomcat下冲突
- Double it 2017ACM-ICPCUniversidadNacionaldeColombiaProgrammingContest/Gym101466D
- error: expected '}' before numeric constant 编译错误解决方案
- NOIP2017赛前模拟(2017.10.19)