ImportError:没有名为cElementTree的模块 - Redhat

时间:2013-02-15 20:02:41

标签: linux redhat yum

我在RHEL上运行yum时遇到以下错误。根据我在谷歌上的搜索,它似乎与python有关。

任何人都有任何想法?

Plugin "refresh-packagekit" can't be imported
Loaded plugins: security
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in 
    yummain.user_main(sys.argv[1:], exit_code=True)

......
........
...........

    self.parse(srcfile)
  File "/usr/lib/python2.6/site-packages/yum/repoMDObject.py", line 140, in parse
    parser = iterparse(infile)
  File "/usr/lib/python2.6/site-packages/yum/misc.py", line 1169, in cElementTree_iterparse
    _cElementTree_import()
  File "/usr/lib/python2.6/site-packages/yum/misc.py", line 1164, in _cElementTree_import
    import cElementTree
ImportError: No module named cElementTree


2 个答案:

答案 0 :(得分:1)

如果是Red Hat Enterprise Linux 6.3

解决方案:

  

libexpat.so.1符号链接链接到/ lib64 /中的libexpat.so.1.5.2。但   该目录已重命名为libexpat.so.1.old。重新创建符号链接   用正确的名字解决了这个问题:

# ln -s libexpat.so.1.5.2 libexpat.so.1
# /sbin/ldconfig

答案 1 :(得分:0)

查看此Bug 694812。我希望它会有所帮助。