Chinaunix

标题: No module named yum [打印本页]

作者: konds    时间: 2008-07-04 15:37
标题: No module named yum
No module named yum

#####################################################
今天突然想用yum升级个软件包,发现yum没有安装,下了yum2.4的包,安装后发现yum不能用


[root@mysqls3 ~]# 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.3.4 (#1, Nov  4 2004, 14:06:56)
[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)]

If you cannot solve this problem yourself, please go to
the yum faq at:
  http://wiki.linux.duke.edu/YumFaq


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

安装libxml2-python, python-sqlite, or python-elementtree package 三个包包以为问题解决,结果却还是出现No module named yum。

faq如下:
Q. 7: I installed a new version of yum (or upgraded my whole system) and now when I run yum, I get an error saying "The yum libraries do not seem to be available on your system for this version of python" and "Please make sure the package you used to install yum was built for your install of python." What's wrong with the yum package I've got, or my Python installation, and how do I fix it?

A.

In pre-2.3.? yum This error message is often misleading. To see the real error, run python from the command line, and type import yum. The problem probably isn't with your version of python at all, but with a missing libxml2-python, python-sqlite, or python-elementtree package.

Yum 2.4.x provides a different error with the module import errors, so this will become less confusing.

It also includes a directive to send the error to the mailing list. Really, you should figure out what rpm provides the module that was missing and try to install that.

If you are getting a message that yum itself is the missing module then you probably installed it incorreclty (or installed the source rpm using make/make install). If possible, find a prebuilt rpm that will work for your system like one from Fedora or CentOS. Or, you can download the srpm and do a

rpmbuild --rebuild yum*.src.rpm

Q. 8: Yum is very nice at updating my kernel, but I use the (nvidia | openafs | other module) and yum doesn't seem to handle it well. Could you fix yum to handle this for me?

A. This is a known and non-trivial problem, but people are talking and working on it. Please read ideas on [WWW] this plugin and messages from [WWW] the Google search of the yum archives to get more details.


###################################################
直接用安装盘里的rpm包
[root@mysqls3 ~]# ls /mnt/CentOS/RPMS/y
yelp-2.6.4-2.i386.rpm
ypbind-1.17.2-13.i386.rpm
ypserv-2.13-18.i386.rpm
yp-tools-2.8-7.i386.rpm
yum-2.4.3-4.el4.centos.noarch.rpm
yum-metadata-parser-1.0-8.el4.centos.i386.rpm

[root@mysqls3 ~]# rpm -ivh  /mnt/CentOS/RPMS/yum-2.4.3-4.el4.centos.noarch.rpm
warning: /mnt/CentOS/RPMS/yum-2.4.3-4.el4.centos.noarch.rpm: V3 DSA signature: NOKEY, key ID 443e1821
error: Failed dependencies:
        urlgrabber is needed by yum-2.4.3-4.el4.centos.noarch
        yum-metadata-parser is needed by yum-2.4.3-4.el4.centos.noarch
        yumconf is needed by yum-2.4.3-4.el4.centos.noarch

先安装了 yum-metadata-parser-1.0-8.el4.centos.i386.rpm

其余的依赖关系如下:

urlgrabber的依赖是这个包 python-urlgrabber-2.9.8-2.noarch.rpm
yumconf 的依赖关系就是  centos-yumconf-4-4.5.noarch.rpm

却发现需要安装一个在源安装盘里不存在的包的依赖关系(centos-yumconf),这个不存在的包还真是麻烦,没安装就会出  No module named yum,真是服气centos了让我从s390里找出来centos-yumconf的包来装,解决了此问题。


http://mirror.be10.com/centos/4. ... nf-4-4.5.noarch.rpm

centos-yumconf-4-4.5.noarch.rpm.tar

10 KB, 下载次数: 620






欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2