Yum error – ImportError: No module named cElementTree
来源:互联网 发布:淘宝如何晒单 编辑:程序博客网 时间:2024/05/17 23:29
Got the following error while trying to install a package using yum.
ImportError: No module named cElementTree
Fix:
Here we need to understand, the issue might be due to some python module loading error, as yum works with python. To debug that, we can load the error module manually.
Get into python command line.
root@test [/]# python
Python 2.6.6 (r266:84292, Sep 11 2012, 08:34:23)[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> from xml.etree import cElementTreeTraceback (most recent call last):
File "<stdin>", line 1, in <module> File "/usr/lib64/python2.6/xml/etree/cElementTree.py", line 3, in <module> from _elementtree import *ImportError: /usr/lib64/python2.6/lib-dynload/pyexpat.so: symbol XML_SetHashSalt, version EXPAT_2_0_1_RH not defined in file libexpat.so.1 with link time reference>>> quit
You can see there is error while loading the cElementTree python module. Its related to the libexpat.so.1 as you see from error message. There is some version error in this file. We need to find the path of this file.
Use strace
strace -o /root/yum.txt yum listSee this file to get the path where yum list access libexpat.so.1
root@test [/]# grep libexpat.so.1 /root/yum.txtopen("/usr/lib64/libexpat.so.1", O_RDONLY) = 13The file /usr/lib64/libexpat.so.1 is corrupted. We can either re-install this lib with rpm/yum or do a fresh install. As yum is broken we cannot easily re-install via rpmWe can install a the expat in a custom location from source.
wget http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/downloadtar -zxf expat-2.1.0.tar.gzcd expat-2.1.0./configure --prefix=/usr/local/myexpatmakemake install
root@test [/]# ll /usr/local/myexpat/lib/libexpat.so.1lrwxrwxrwx. 1 root root 17 Jan 28 19:57 /usr/local/myexpat/lib/libexpat.so.1 -> libexpat.so.1.6.0*We can use this new lib as the server default expat library. For this rename the original lib in the path /usr/lib64 to a different name. If the file /usr/lib64/libexpat.so.1 is a symlink to libexpat.so.1.X.X, then just unlink the file /usr/lib64/libexpat.so.1
mv /usr/lib64/libexpat.so.1 /usr/lib64/libexpat.so.1.OLD
ln -s /usr/local/myexpat/lib/libexpat.so.1.6.0 /usr/lib64/libexpat.so.1Thats it. Yum will now work fine.
root@test [/]# yum list | grep vim-enhancedvim-enhanced.x86_64 2:7.2.411-1.8.el6 @base
0 0
- Yum error – ImportError: No module named cElementTree
- Centos Yum error – ImportError: No module named cElementTree
- yum错误ImportError: No module named cElementTree的处理
- py2exe error: "ImportError: No module named httplib"
- 【Error】ImportError No module named Leap
- ImportError: No module named ...
- ImportError: No module named ***
- ImportError:No module named
- ImportError: No module named
- ImportError: No module named ×××××
- yum 出现错误ImportError: No module named urlgrabber.grabber
- The error in python :ImportError: No module named xxx
- Pycharm throws error :ImportError: No module named sklearn
- Python Error : ImportError: No module named 'xml.etree'
- ImportError: No module named vtkCommonPython
- ImportError: No module named win32api
- ImportError: No module named tagging_autocomplete
- ImportError: No module named flask_babelex
- 【C#】String 格式化使用说明
- Hadoop启动报Error: JAVA_HOME is not set and could not be found解决办法
- VxWorks驱动程序开发指南--驱动程序的组织结构
- 理解进程调度时机跟踪分析进程调度与进程切换的过程
- Java高级深入与JVM
- Yum error – ImportError: No module named cElementTree
- uda1341之L3接口介绍
- 【GDOI2017第二轮模拟day2】开房间
- 从Chrome源码看JS Array的实现
- C++之智能指针
- 数据库管理
- Anaconda python版本的切换
- Linux下僵尸进程和孤儿进程模拟
- URAL 1993 This cheeseburger you don't need