我正在CentOS上安装mysqldb,但不能。我需要使用yum,但是当我输入yum时,会出现以下错误。

root@osp [/home/hmm/RentalWanted]# 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.3 (default, Dec 11 2012, 20:12:43)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)]

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


我指的是Simeon建议的this链接,用于尝试下载这些rpm的解决方案

wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-2.4.3-46.el5_8.2.i386.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-devel-2.4.3-46.el5_8.2.i386.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-libs-2.4.3-46.el5_8.2.i386.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-tools-2.4.3-46.el5_8.2.i386.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/tix-8.4.0-11.fc6.i386.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/tix-devel-8.4.0-11.fc6.i386.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/tkinter-2.4.3-46.el5_8.2.i386.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm


下载时出现的错误是这个

wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-tools-2.4.3-46.el5_8.2.i386.rpm
--2014-12-08 01:58:40--  http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-tools-2.4.3-46.el5_8.2.i386.rpm
Resolving mirror.centos.org... 216.172.56.29
Connecting to mirror.centos.org|216.172.56.29|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2014-12-08 01:58:40 ERROR 404: Not Found.

最佳答案

您应该看到this link出现与您相同的问题。尝试下载此rpm:

python-2.4.3-46.el5_8.2.i386.rpm

python-devel-2.4.3-46.el5_8.2.i386.rpm

python-libs-2.4.3-46.el5_8.2.i386.rpm

python-tools-2.4.3-46.el5_8.2.i386.rpm

tix-8.4.0-11.fc6.i386.rpm

tix-devel-8.4.0-11.fc6.i386.rpm

tkinter-2.4.3-46.el5_8.2.i386.rpm

yum-3.2.22-39.el5.centos.noarch.rpm

关于python - 没有用于安装mysqldb的名为Yum的模块,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/27352381/

10-11 03:21