我正在尝试安装 libxml2 库。安装过程中出现此错误。
make[4]: Entering directory `/home/madhuv/y/libxml2-2.9.2/python'
CC libxml.lo
libxml.c:14:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
make[4]: *** [libxml.lo] Error 1
make[4]: Leaving directory `/home/madhuv/y/libxml2-2.9.2/python'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/madhuv/y/libxml2-2.9.2/python'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/madhuv/y/libxml2-2.9.2/python'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/madhuv/y/libxml2-2.9.2'
make: *** [all] Error 2.
请帮我。
答案1
您需要开发库libpython-dev
:
sudo apt-get install libpython-dev
目前该命令安装libpython2.7-dev
$ apt-file search /Python.h
[..]
libpython2.7-dbg: /usr/include/python2.7_d/Python.h
libpython2.7-dev: /usr/include/python2.7/Python.h
libpython3.4-dbg: /usr/include/python3.4dm/Python.h
libpython3.4-dev: /usr/include/python3.4m/Python.h
[..]