python升级安装后的yum的修复
升级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安装,成功;
python升级安装后的yum的修复的更多相关文章
- fedora安装后,yum命令不能使用,Cannot retrieve metalink for repository: fedora. Please verify its path and try again 解决方法
fedora安装后,yum命令不能使用,Cannot retrieve metalink for repository: fedora. Please verify its path and try ...
- linux系统下python升级安装
1.安装gcc gcc-c++ yum install -y gcc gcc-c++ #提前检查是否安装 2.下载python3.5.2安装包 cd /usr/local/src/ wget http ...
- python升级或者其他原因把yum搞坏了
第一个命令查询出来,原本是安装的啥版本 rpm -qa | grep python- | grep 2.6 然后执行下一个命令,就可以安装原本的python版本了,注意链接要换成你对应的那个版本 rp ...
- notepad中运行python, --kali安装后出现乱码
notepad中运行python cmd /k python "$(FULL_CURRENT_PATH)" & ECHO. & PAUSE & EXIT - ...
- centos 7系统,解决python3.x 安装后使用yum不能安装的问题(错误:urlgrabber-ext-down | KeyboardInterrupt)
1.在安装python3.xx版本后,通过yum去安装软件会出现问题,目前我遇到的有2种问题 比如显示:urlgrabber-ext-down Downloading packages: File & ...
- Python首次安装后运行报错(0xc000007b)的解决方法
最近在安装完Python后运行发现居然报错了,错误代码是0xc000007b,于是通过往上查找发现是因为首次安装Python缺乏VC++库的原因,下面通过这篇文章看看如何解决这个问题吧. 错误提示 ...
- python pip ,安装,卸载,查看等命令,不同版本
pycharm及python的使用说明 Python和 pycharm的使用 1. pycharm和Python 下载 安装后需要激活码.判断Python是否安装好了,cmd下跑: python ...
- CENTOS下Python 升级后YUM无法使用的解决办法
Python有很多实用的工具,安装依赖python版本较高,升级Python后导致yum无法使用. 原因: 系统自带的yum依赖Python老版本,升级后不兼容 解决办法: 1. 列出所有版本,确定老 ...
- centos7升级Python版本后,yum不能正常使用
python升级方法,使用源码编译安装即可,prefix=/usr/local/bin/python3 执行yum list,提示/usr/bin/yum 报错 我是直接在Python2.7的基础上又 ...
随机推荐
- 配置微信api调扫码功能
var url = encodeURIComponent(location.href.split('#')[0]); $.get(iapi+'/htweb/wx/getJsSdkSign?url='+ ...
- s 中日期 转换成时间戳 例如2013-08-30 转换为时间戳
以前遇到过一个关于时间戳的问题,为了不被大家鄙视,先说一下概念. 具体时间戳怎么定义的我也不清楚,但百度百科中有这么一句:“时间戳是自 1970 年 1 月 1 日(00:00:00 GMT)至当前时 ...
- Rust-HayStack
src/main.rs extern crate multipart; extern crate iron; extern crate time; //image converter extern c ...
- Codeforces 632F Magic Matrix(bitset)
题目链接 Magic Matrix 考虑第三个条件,如果不符合的话说明$a[i][k] < a[i][j]$ 或 $a[j][k] < a[i][j]$ 于是我们把所有的$(a[i][j ...
- win7下用PyInstaller把Python代码打包成exe文件
2013-11-05 22:02:14| 1.安装 使用PyInstaller需要安装PyWin32. 下载与Python对应的PyInstaller版本,解压后就算安装好了. 例如,安装了PyI ...
- 洛谷—— P1609 最小回文数
https://www.luogu.org/problemnew/show/1609 题目描述 回文数是从左向右读和从右向左读结果一样的数字串. 例如:121.44 和3是回文数,175和36不是. ...
- Algorithm | hash
A basic requirement is that the function should provide a uniform distribution of hash values. A non ...
- CodeForces - 316E3 Summer Homework
Discription By the age of three Smart Beaver mastered all arithmetic operations and got this summer ...
- Google开源基于Tensorflow的NLP框架重大升级
http://weibo.com/ttarticle/p/show?id=2309404086117195475716
- Learn How To Attach PL/SQL Library In Oracle Forms
To attach a PL/SQL library in the Oracle Forms follow the following steps:1. Click on Attached Libra ...