Python 在ubuntu上安装PyXML

Python 在ubuntu上安装PyXML,python,package,Python,Package,我需要在python 2.7.5上安装PyXML :~/Desktop/PyXML-0.8.4$ sudo python setup.py install running install running build running build_py running build_ext building '_xmlplus.parsers.pyexpat' extension x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG

我需要在python 2.7.5上安装PyXML

:~/Desktop/PyXML-0.8.4$ sudo python setup.py install 
running install
running build
running build_py
running build_ext
building '_xmlplus.parsers.pyexpat' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DXML_NS=1 -DXML_DTD=1 -DBYTEORDER=1234 -DXML_CONTEXT_BYTES=1024 -Iextensions/expat/lib -I/usr/include/python2.7 -c extensions/pyexpat.c -o build/temp.linux-x86_64-2.7/extensions/pyexpat.o
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DXML_NS=1 -DXML_DTD=1 -DBYTEORDER=1234 -DXML_CONTEXT_BYTES=1024 -Iextensions/expat/lib -I/usr/include/python2.7 -c extensions/expat/lib/xmlparse.c -o build/temp.linux-x86_64-2.7/extensions/expat/lib/xmlparse.o
extensions/expat/lib/xmlparse.c:75:2: error: #error memmove does not exist on this platform, nor is a substitute available
 #error memmove does not exist on this platform, nor is a substitute available
  ^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
如何修复此错误? 编辑:

编辑2:

sudo apt-get install python-xml
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python-xml

我认为您需要先安装
python2.7-dev

尝试:


另外,在安装python模块时最好使用
pip
。。无论如何,试一试。

以下内容在Ubuntu 12.10上对我有效:

sudo apt-get install pip

sudo pip install PyXML

Downloading/unpacking PyXML
Running setup.py egg_info for package PyXML

您最好的方法是在
/usr/include/python2.7/pyconfig.h
的顶部添加
#define_MEMMOVE 1


请参阅:

mmm如果您尝试以这种方式安装它
sudo apt get install python xml
它会返回任何错误吗?这不会为我解决问题。您已将错误答案标记为已接受。请用一个惊喜提示来纠正它,先生+1:)
sudo apt-get install python2.7-dev
sudo apt-get install pip

sudo pip install PyXML

Downloading/unpacking PyXML
Running setup.py egg_info for package PyXML