yum中的python版本错误(转载)
来源:互联网 发布:淘宝开店推广费用 编辑:程序博客网 时间:2024/06/07 07:38
1、报错信息如下:
[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:
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
错误原因:错误信息描述为
2、执行yum查看信息
[root@develop bin]# yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
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
提示当前版本是2.6.1可能版本不匹配。没有yum依赖的包。
3、查看yum版本
[root@develop local]# rpm -qa |grep yum
yum-3.2.8-9.el5.centos.1
yum-metadata-parser-1.1.2-2.el5
4、查看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
5、执行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.
>>>
6、猜测yum调用了高版本的python。
7、解决方法:
查找yum文件,并编辑此py文件
[root@develop local]# which yum
/usr/bin/yum
[root@develop local]# vi /usr/bin/yum
将
#!/usr/bin/python
改为:
#!/usr/bin/python2.4
然后保存OK.
补充:yum基于python写的。
- yum中的python版本错误(转载)
- yum中的python版本错误(转载)
- centos7安装多版本python导致yum命令错误(no module named yum)的解决办法
- Python升级导致的yum错误
- Python中的matplotlib用法(转载)
- 深入理解Python中的生成器(转载)
- (转载)Google 面试题 | 132模式 Python 版本
- yum使用过程中的常见错误
- yum使用过程中的常见错误
- maya2016中的python版本
- 升级Python版本后 yum命令不可用
- 【疑难杂症】-CentOS-修改python版本后yum运行出错
- CentOS 6.5升级Python版本、修复yum和安装模块
- 解决python多版本,yum无法使用的情况
- redheat 上python 版本切换后导致yum用不了
- 升级Python版本后不能使用yum命令
- Python中的操作符--转载
- Python中的内存管理【转载】
- Middle-题目63:147. Insertion Sort List
- 【JavaScript 】函数柯里化
- 欢迎使用CSDN-markdown编辑器
- Shell字符串
- 说说JSON和JSONP,也许你会豁然开朗
- yum中的python版本错误(转载)
- Middle-题目64:95. Unique Binary Search Trees II
- 从杭电OJ1219 到getchar 以及EOF
- 第十四周项目1.1—排序函数模板(冒泡法排序)
- [WFD] WFD 连接做connect和disconnect,手机概率性的没有反应以及重启
- PHP中读取文件的几个方法
- Android群英传读书笔记第六章(Android绘图机制与处理技巧)
- Android产品研发(三)-->基类Activity
- Android学习笔记六十:无线 WIFI 的13个信道频率范围