python升级导致yum命令无法使用的解决
1、报错信息如下:
- [root@develop bin]# yum
- [root@develop local]# yum -y install prce
- 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.
- It's possible that the above module doesn't match the
- current version of Python, which is:
- 2.6.1 (r261:67515, Aug 7 2010, 11:36:17)
- [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
- If you cannot solve this problem yourself, please go to
- the yum faq at:
- http://wiki.linux.duke.edu/YumFaq
错误原因:错误信息描述为 yum 所依赖的python 不相符,请安装相对应的python即可
2、查看yum版本
[root@develop local]# rpm -qa |grep yum
yum-3.2.8-9.el5.centos.1
yum-metadata-parser-1.1.2-2.el5
3、查看python版本
- [root@develop local]# whereis python
- python: /usr/bin/python2.4 /usr/bin/python /usr/lib/python2.4 /usr/local/bin/python2.6 /usr/local/bin/python2.6-config /usr/local/bin/python /usr/local/lib/python2.6 /usr/share/man/man1/python.1.gz
果然装了两个版本python
4、执行python,查看到使用2.6.1的版本
- [root@develop local]# python
- Python 2.6.1 (r261:67515, Aug 7 2010, 11:36:17)
- [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
- Type "help", "copyright", "credits" or "license" for more information.
- >>>
5、猜测yum调用了高版本的python。
6、解决方法:
查找yum和 yum-updatest文件,并编辑此py文件
- [root@develop local]# which yum
- /usr/bin/yum
- [root@develop local]# vi /usr/bin/yum
- [root@develop local]# vi /usr/bin/yum-updatest
将
#!/usr/bin/python
改为:
#!/usr/bin/python2.4
python升级导致yum命令无法使用的解决的更多相关文章
- python升级导致yum命令无法使用的解决办法?
yum是依赖特定的python版本的,不同的linux系统需要的python版本不同. 查看yum的启动脚本:which is yum 头一行指定使用的python版本,这个必须是系统需要的,而不要使 ...
- CENTOS下Python 升级后YUM无法使用的解决办法
Python有很多实用的工具,安装依赖python版本较高,升级Python后导致yum无法使用. 原因: 系统自带的yum依赖Python老版本,升级后不兼容 解决办法: 1. 列出所有版本,确定老 ...
- linux下php命令无法使用如何解决
本文主要和大家分享linux下php命令无法使用如何解决,测试是否添加php环境变量方法: 如下:输入php -v 显示 php 命令没有找到 [root@iz8vbhc4d7zoazstpw7gw8 ...
- 升级python导致yum报错的解决方法
把python从2.7升级到3.6后 , 使用yum报错 File ‘’/usr/bin/yum'', line 30 except KeyboardInterrupt, e: ^ 故障原因:yum采 ...
- 如何解决python升级后yum报错
当我们yum命令的时候,会提示 "File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxEr ...
- CentOS——yum命令运行错误解决办法
问题: [root@name user]# yum File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ...
- Windows下pip命令无法使用的解决办法
今天遇见了一个pip相关的问题 如下 我的python环境变量也有,但是还是无法使用pip 经过一位大佬的点播使用,使用python -m ensurepip这个命令可以检查 在cmd下运行自动完成p ...
- Python 升级致yum 问题,pip 异常
升级 Python 导致 yum 和 pip 异常: 一些storm 和 自定义项目 需要升级python版本:Linux 系统默认是2.6 版本 ,所以需要根据业务进行升级操作:Python 官方下 ...
- centos 5的yum源无法使用的解决方法( 转载)
由于centos 5 已经停更.于是导致yum源也不能用了. 例如安装screen的时候提示 Determining fastest mirrors* base: denver.gaminghost. ...
随机推荐
- Android 多线程之HandlerThread 完全详解
关联文章: Android 多线程之HandlerThread 完全详解 Android 多线程之IntentService 完全详解 android多线程-AsyncTask之工作原理深入解析(上) ...
- Delphi 7下最小化到系统托盘
在Delphi 7下要制作系统托盘,只能制作一个比较简单的系统托盘,因为ShellAPI文件定义的TNotifyIconData结构体是比较早的版本.定义如下: 123456789 _NOTIFY ...
- Arduino+GPRS 的环境监控方案
设备前台界面:http://www.lewei50.com/home/gatewaystatus/361#576 本实采用的硬件,除了一个串口模块以外(约200元),其他均可以从taobo上面找到标准 ...
- 50行代码实现缓存,JAVA内存模型原理
遇见这样的高人怎么办??下面是一个简单缓存的实现,相当牛叉!自己看吧,只有50行代码. 摘自:http://www.oschina.net/code/snippet_55577_3887 import ...
- LeetCode(28)Implement strStr()
题目 Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if nee ...
- eclipse sun.net 下包无法导入问题
项目中用到了:sun.net.ConnectionResetException.但是sun.net包里的类,在eclipse里默认是不让用的. 解决办法是自定义access rules 工程上右键-& ...
- DevExpress 15.1.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio VisualStudioVersion = 14 ...
- Charles的HTTPS抓包方法及原理,下载安装ssl/https证书
转自:https://zhubangbang.com/charles-https-packet-capture-method-and-principle.html 本文的Charles,适应windo ...
- Zend Framework(一) windows8.1下配置zend framework1.12
windows8.1下配置zend framework1.12配置步骤: 1. 下载 zend framework1.12库 2. 创建zend frameworkproject 2 ...
- linux 修改时间
实例:设置时间伟2008年8月8号12:00# date -s "2008-08-08 12:00:00"修改完后,记得执行clock -w,把系统时间写入CMOS date -s ...