{"id":235,"hash":"e057c7c3f284a73601d37100d1d7c6377a5b0d17c4ac5817134b45b47c21fe2e","pattern":"libxml install error using pip","full_message":"This is my error:\n\n(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install lxml\nDownloading/unpacking lxml\n  Running setup.py egg_info for package lxml\n    Building lxml version 2.3.\n    Building without Cython.\n    ERROR: /bin/sh: xslt-config: not found\n\n    ** make sure the development packages of libxml2 and libxslt are installed **\n\n    Using build configuration of libxslt\nInstalling collected packages: lxml\n  Running setup.py install for lxml\n    Building lxml version 2.3.\n    Building without Cython.\n    ERROR: /bin/sh: xslt-config: not found\n\n    ** make sure the development packages of libxml2 and libxslt are installed **\n\n    Using build configuration of libxslt\n    building 'lxml.etree' extension\n    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.6/src/lxml/lxml.etree.o -w\n    src/lxml/lxml.etree.c:4: fatal error: Python.h: 没有那个文件或目录\n    compilation terminated.\n    error: command 'gcc' failed with exit status 1\n    Complete output from command /home/zjm1126/zjm_test/mysite/bin/python -c \"import setuptools;__file__='/home/zjm1126/zjm_test/mysite/build/lxml/setup.py';execfile(__file__)\" install --single-version-externally-managed --record /tmp/pip-jOhgvD-record/install-record.txt --install-headers /home/zjm1126/zjm_test/mysite/include/site/python2.6:\n    Building lxml version 2.3.\n\nBuilding without Cython.\n\nERROR: /bin/sh: xslt-config: not found\n\n** make sure the development packages of libxml2 and libxslt are installed **\n\nUsing build configuration of libxslt\n\nrunning install\n\nrunning build\n\nrunning build_py\n\nrunning build_ext\n\nbuilding 'lxml.etree' extension\n\ngcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.6/src/lxml/lxml.etree.o -w\n\nsrc/lxml/lxml.etree.c:4: fatal error: Python.h: 没有那个文件或目录\n\ncompilation terminated.\n\nerror: command 'gcc' failed with exit status 1\n\n----------------------------------------\nCommand /home/zjm1126/zjm_test/mysite/bin/python -c \"import setuptools;__file__='/home/zjm1126/zjm_test/mysite/build/lxml/setup.py';execfile(__file__)\" install --single-version-externally-managed --record /tmp/pip-jOhgvD-record/install-record.txt --install-headers /home/zjm1126/zjm_test/mysite/include/site/python2.6 failed with error code 1\nStoring complete log in /home/zjm1126/.pip/pip.log\n\nWhat can I do?\n\nupdated:\n\n(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install lxml\nDownloading/unpacking lxml\n  Running setup.py egg_info for package lxml\n    Building lxml version 2.3.\n    Building without Cython.\n    Using build configuration of libxslt 1.1.26\n    Building against libxml2/libxslt in the following directory: /usr/lib\nInstalling collected packages: lxml\n  Running setup.py install for lxml\n    Building lxml version 2.3.\n    Building without Cython.\n    Using build configuration of libxslt 1.1.26\n    Building against libxml2/libxslt in the following directory: /usr/lib\n    building 'lxml.etree' extension\n    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/usr/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.6/src/lxml/lxml.etree.o -w\n    src/lxml/lxml.etree.c:4: fatal error: Python.h: 没有那个文件或目录\n    compilation terminated.\n    error: command 'gcc' failed with exit status 1\n    Complete output from command /home/zjm1126/zjm_test/mysite/bin/python -c \"import setuptools;__file__='/home/zjm1126/zjm_test/mysite/build/lxml/setup.py';execfile(__file__)\" install --single-version-externally-managed --record /tmp/pip-NJw2ws-record/install-record.txt --install-headers /home/zjm1126/zjm_test/mysite/include/site/python2.6:\n    Building lxml version 2.3.\n\nBuilding without Cython.\n\nUsing build configuration of libxslt 1.1.26\n\nBuilding against libxml2/libxslt in the following directory: /usr/lib\n\nrunning install\n\nrunning build\n\nrunning build_py\n\nrunning build_ext\n\nbuilding 'lxml.etree' extension\n\ngcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/usr/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.6/src/lxml/lxml.etree.o -w\n\nsrc/lxml/lxml.etree.c:4: fatal error: Python.h: 没有那个文件或目录\n\ncompilation terminated.\n\nerror: command 'gcc' failed with exit status 1\n\n----------------------------------------\nCommand /home/zjm1126/zjm_test/mysite/bin/python -c \"import setuptools;__file__='/home/zjm1126/zjm_test/mysite/build/lxml/setup.py';execfile(__file__)\" install --single-version-externally-managed --record /tmp/pip-NJw2ws-record/install-record.txt --install-headers /home/zjm1126/zjm_test/mysite/include/site/python2.6 failed with error code 1\nStoring complete log in /home/zjm1126/.pip/pip.log\n\nthe log:\n\n------------------------------------------------------------\n/home/zjm1126/zjm_test/mysite/bin/pip run on Thu Mar  3 17:07:27 2011\nDownloading/unpacking mysql-python\n  Running setup.py egg_info for package mysql-python\n    running egg_info\n    creating pip-egg-info/MySQL_python.egg-info\n    writing pip-egg-info/MySQL_python.egg-info/PKG-INFO\n    writing top-level names to pip-egg-info/MySQL_python.egg-info/top_level.txt\n    writing dependency_links to pip-egg-info/MySQL_python.egg-info/dependency_links.txt\n    writing pip-egg-info/MySQL_python.egg-info/PKG-INFO\n    writing top-level names to pip-egg-info/MySQL_python.egg-info/top_level.txt\n    writing dependency_links to pip-egg-info/MySQL_python.egg-info/dependency_links.txt\n    writing manifest file 'pip-egg-info/MySQL_python.egg-info/SOURCES.txt'\n    warning: manifest_maker: standard file '-c' not found\n    reading manifest file 'pip-egg-info/MySQL_python.egg-info/SOURCES.txt'\n    reading manifest template 'MANIFEST.in'\n    warning: no files found matching 'MANIFEST'\n    warning: no files found matching 'ChangeLog'\n    warning","ecosystem":"pypi","package_name":"lxml","package_version":null,"solution":"** make sure the development packages of libxml2 and libxslt are installed **\n\nFrom the lxml documentation, assuming you are running a Debian-based distribution :\n\nsudo apt-get install libxml2-dev libxslt-dev python-dev\n\nFor Debian based systems, it should be enough to install the known build dependencies of python-lxml or python3-lxml, e.g.\n\nsudo apt-get install build-dep python3-lxml","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/5178416/libxml-install-error-using-pip","votes":321,"created_at":"2026-04-19T04:41:35.778597+00:00","updated_at":"2026-04-19T04:51:47.827727+00:00"}