python开发出现”Nomodulenamedyum”错误的解决办法
本篇内容主要讲解“python开发出现”No module named yum”错误的解决办法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“python开发出现”No module named yum”错误的解决办法”吧!
创新互联建站专注为客户提供全方位的互联网综合服务,包含不限于网站设计、网站建设、夏县网络推广、小程序定制开发、夏县网络营销、夏县企业策划、夏县品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联建站为所有大学生创业者提供夏县建站搭建服务,24小时服务热线:18982081108,官方网址:www.cdcxhl.com
今天用yum安装软件的时候出现如下错误:
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.2 (default, Feb 15 2016, 15:15:03) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)]
yum 错误,搜索一番后知道是yum和Python是依赖关系,yum是python的模块,所以采用以下解决方案:
[root@master1 ~]# python Python 2.7.2 (default, Feb 15 2016, 15:15:03) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
[root@master1 ~]# whereis python python: /usr/bin/python2.6 /usr/bin/python.bak /usr/bin/python /usr/lib/python2.6 /usr/lib64/python2.6 /usr/local/bin/python2.7 /usr/local/bin/python2.7-config /usr/local/bin/python /usr/local/lib/python2.7 /usr/include/python2.6 /usr/share/man/man1/python.1.gz
肯定是yum的版本与当前python的版本不一致造成的
所以修改yum的配置
修改文件: vim /usr/bin/yum
修改头#!/usr/bin/python => #!/usr/bin/python2.6,问题解决
到此,相信大家对“python开发出现”No module named yum”错误的解决办法”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
网页名称:python开发出现”Nomodulenamedyum”错误的解决办法
本文网址:http://scyanting.com/article/gojodd.html