AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 472960
Accepted
kenorb
kenorb
Asked: 2013-01-29 01:27:34 +0800 CST2013-01-29 01:27:34 +0800 CST 2013-01-29 01:27:34 +0800 CST

如何修复 yum 错误:没有名为 CElementTree 的模块?

  • 772

我对 yum 有以下问题:

$ 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 cElementTree

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.4.3 (#1, Feb 22 2012, 16:06:13) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)]

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

我的操作系统:CentOS 5.8 版(最终版)

尝试从 RPM 包手动安装 python-elementtree 时,出现以下错误:

$ sudo rpm -i http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm
package python-elementtree-1.2.6-7.el4.rf.i386 (which is newer than python-elementtree-1.2.6-5.i386) is already installed
$ sudo rpm -i http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm

相关链接:

  • http://www.rickrodriguezjr.com/wordpress/archives/183
  • http://www.webhostingtalk.com/showthread.php?t=936132
  • http://www.clearfoundation.com/component/option,com_kunena/Itemid,232/catid,26/func,view/id,45278/
  • http://pingd.org/2012/no-module-named-celementtree-yum-update-error.html
  • http://forums.contribs.org/index.php?topic=49189.0
  • http://www.centos.org/modules/newbb/viewtopic.php?topic_id=3401
centos
  • 2 2 个回答
  • 7125 Views

2 个回答

  • Voted
  1. Dennis Kaarsemaker
    2013-01-29T01:41:47+08:002013-01-29T01:41:47+08:00

    嗯,是否还安装了 python-elementtree?cEleementTree 模块应该位于/usr/lib64/python2.4/site-packages/cElementTree.so(/usr/lib/... 在 32 位系统上)。那个文件还存在吗?

    如果软件包丢失,您可以使用 rpm 重新安装它:

    x86_64:

    rpm -i http://mirror.centos.org/centos-5/5/os/x86_64/CentOS/python-elementtree-1.2.6-5.x86_64.rpm
    

    i386:

    rpm -i http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm
    
    • 1
  2. Best Answer
    kenorb
    2013-01-29T03:10:36+08:002013-01-29T03:10:36+08:00

    解决方案

    尝试python-elementtree手动下载安装:

    x86_64

    wget http://mirrors.usc.edu/pub/linux/distributions/centos/5.8/os/x86_64/CentOS/python-elementtree-1.2.6-5.x86_64.rpm
    sudo rpm -Uvh python-elementtree-*.rpm
    

    i386

    wget http://mirrors.usc.edu/pub/linux/distributions/centos/5.8/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm
    sudo rpm -Uvh python-elementtree-*.rpm
    

    故障排除

    错误:'包 python-elementtree-1.2.6-7.el4.rf.i386(比 python-elementtree-1.2.6-5.i386 更新)已经安装'或类似的

    尝试替换包,即使它是通过以下方式安装的:

    sudo rpm -iv --replacepkgs python-elementtree-*.rpm
    

    或者:

    sudo rpm -iv --replacefiles python-elementtree-*.rpm
    

    或者最后:

    sudo rpm -iv --force python-elementtree-*.rpm
    

    请参阅:--replacepkgs:安装包,即使已经安装

    • 1

相关问题

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 使用 crontab 和 /etc/cron.hourly,daily,weekly 的区别

  • 持续监控许多服务器运行状况的简单方法?

  • Hudson 无法在 tomcat5 中启动

  • CentOS 的依赖挑战

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve