Python 2.7 无法在Python 2.7和CentOS 7中导入libxml2和libxslt

Python 2.7 无法在Python 2.7和CentOS 7中导入libxml2和libxslt,python-2.7,libxml2,centos7,libxslt,Python 2.7,Libxml2,Centos7,Libxslt,无法在python2.7和CentOS 7中导入libxml2和libxslt 但系统表示安装了以下软件包: Package libxml2-2.9.1-5.el7_1.2.x86_64 already installed and latest version Package libxml2-devel-2.9.1-5.el7_1.2.x86_64 already installed and latest version Package libxslt-1.1.28-5.el7.x86_64 a

无法在
python2.7
CentOS 7
中导入
libxml2
libxslt

但系统表示安装了以下软件包:

Package libxml2-2.9.1-5.el7_1.2.x86_64 already installed and latest version
Package libxml2-devel-2.9.1-5.el7_1.2.x86_64 already installed and latest version
Package libxslt-1.1.28-5.el7.x86_64 already installed and latest version
Package libxslt-devel-1.1.28-5.el7.x86_64 already installed and latest version
但不能在Python2.7中导入

Python 2.7.5 (default, Jun 24 2015, 00:41:19) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libxml2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named libxml2
>>> import libxslt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named libxslt
>>> 
Python 2.7.5(默认值,2015年6月24日00:41:19)
[GCC 4.8.3 20140911(红帽4.8.3-9)]关于linux2
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。
>>>导入libxml2
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
ImportError:没有名为libxml2的模块
>>>导入libxslt
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
ImportError:没有名为libxslt的模块
>>> 
libxml2安装步骤

yum groupinstall "Development Tools"

yum  install python-devel.x86_64

rpmbuild -ba /usr/src/redhat/SPECS/libxml2.spec (this might not be required.)

##go to  RPMS/x86_64/

rpm -Uvh libxml2-python-2.7.8-1.x86_64.rpm --nodeps
wget  http://xmlsoft.org/sources/libxslt-1.1.28.tar.gz

cd libxslt-1.1.28

./configure --with-python=/usr/bin/python2.7

make

make install
===================================================================

libxslt安装步骤

yum groupinstall "Development Tools"

yum  install python-devel.x86_64

rpmbuild -ba /usr/src/redhat/SPECS/libxml2.spec (this might not be required.)

##go to  RPMS/x86_64/

rpm -Uvh libxml2-python-2.7.8-1.x86_64.rpm --nodeps
wget  http://xmlsoft.org/sources/libxslt-1.1.28.tar.gz

cd libxslt-1.1.28

./configure --with-python=/usr/bin/python2.7

make

make install

==========================================================

我不明白。请解释一下。