由于功能及程序依赖,需要将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
相关文章
标签:服务器技术
- •VMware Workstation Pro 16安装CentOS7超详细图文步骤
- •CentOS7下配置使用JumpServer 堡垒机 (图文教程)
- •CentOS安装jdk的几种方法及配置环境变量方式
- •CentOS忘记密码修改方案以及centos卡在开机登录界面,命令失效的解决方法
- •解决笔记本安装centos7后无法调节屏幕亮度
- •VMware安装CentOS 8.1(CentOS 8系列可参考)的图文详细教程
- •CentOS7 minimal 最小化安装网络设置过程
- •CentOS7下搭建JumpServer
- •CentOS安装rpm包出现冲突时的解决办法
- •Vmware下CentOS7最小化安装方式