博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python升级安装后的yum的修复
阅读量:6610 次
发布时间:2019-06-24

本文共 1333 字,大约阅读时间需要 4 分钟。

升级python版本号后,执行yum

# yum -y install openssl

提演示样例如以下:

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.7.3 (default, Jul 15 2014, 16:52:36) 

[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)]


If you cannot solve this problem yourself, please go to 

the yum faq at:

  http://wiki.linux.duke.edu/YumFaq


分析应该是yum和Python是依赖关系,yum是python的模块,所以须要改动yum来解决:

1. 查看python的安装路径

# python

Python 2.7.3 (default, Jul 15 2014, 16:52:36) 

[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>>

# whereis python

python: /usr/bin/python2.4 /usr/bin/python /usr/bin/python2.6 /usr/lib/python2.4 /usr/local/bin/python 

/usr/local/bin/python2.6-config /usr/local/bin/python3.3-config /usr/local/bin/python3.3 /usr/local/bin/python3.3m 

/usr/local/bin/python3.3m-config /usr/local/bin/python2.6 /usr/local/lib/python2.4 /usr/local/lib/python3.3 

/usr/local/lib/python2.6 /usr/include/python2.4 /usr/share/man/man1/python.1.gz


2. 改动yum

# vim /usr/bin/yum

将 #!/usr/bin/python 改成  #!/usr/bin/python2.4

【保存并退出】


3. 再測试yum安装,成功;

转载地址:http://rniso.baihongyu.com/

你可能感兴趣的文章
如何安装nginx第三方模块
查看>>
LXC学习实践(3)快速体验第一个容器
查看>>
转:winform_webApiSelfHost及 OWIN WebAPI Service
查看>>
分库分表的理想方案
查看>>
sumatrapdf 软件介绍
查看>>
CentOS开启和关闭防火墙
查看>>
值得学习的C语言开源项目
查看>>
AutoCAD如何设置A0A1图纸
查看>>
maven
查看>>
debug命令
查看>>
Android SQLite详解
查看>>
Spark技术在京东智能供应链预测的应用
查看>>
SparkR-Install
查看>>
Tagger: Deep Unsupervised Perceptual Grouping
查看>>
Intellij idea 项目目录设置 与包的显示创建
查看>>
HDU 1016:Prime Ring Problem
查看>>
Impala的安装(含使用CM安装 和 手动安装)(图文详解)
查看>>
论程序猿的社会地位
查看>>
Android 布局自适应屏幕
查看>>
ionic 进入二级目录以后隐藏底部导航栏(tabs)
查看>>