1818IP-服务器技术教程,云服务器评测推荐,服务器系统排错处理,环境搭建,攻击防护等

当前位置:首页 - Linux系统 - centos - 正文

君子好学,自强不息!

由于功能及程序依赖,需要将Centos上的python从2.6升级成2.7,把碰到的一些问题记录如下:

安装好2.7后将原来的/usr/bin/python改成/usr/bin/python26,并将2.7的bin目录加入执行路径

 

Question1: 执行yum报No module named yum

[root@zejin240 ~]# yum list
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.12 (default, Jul  6 2016, 18:40:00) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]

If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

 

解决方法:

vi /usr/binyum

#!/usr/bin/python26

 

 

Question2: 执行pip时提示  ImportError: No module named pip

解决方法:python -m  ensurepip

 

 

Questions3:源码安装paramiko出现各种模块找不到

解决方法:

pip install -I pycrypto
pip install -I paramiko

 

本文来源:1818IP

本文地址:https://www.1818ip.com/post/32798.html

免责声明:本文由用户上传,如有侵权请联系删除!

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。