libxml installieren, Fehler mit pip
Dies ist mein Fehler:
(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install lxml
Downloading/unpacking lxml
Running setup.py egg_info for package lxml
Building lxml version 2.3.
Building without Cython.
ERROR: /bin/sh: xslt-config: not found
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
Installing collected packages: lxml
Running setup.py install for lxml
Building lxml version 2.3.
Building without Cython.
ERROR: /bin/sh: xslt-config: not found
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
building 'lxml.etree' extension
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
src/lxml/lxml.etree.c:4: fatal error: Python.h: 没有那个文件或目录
compilation terminated.
error: command 'gcc' failed with exit status 1
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:
Building lxml version 2.3.
Building without Cython.
ERROR: /bin/sh: xslt-config: not found
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
running install
running build
running build_py
running build_ext
building 'lxml.etree' extension
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
src/lxml/lxml.etree.c:4: fatal error: Python.h: 没有那个文件或目录
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
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 failed with error code 1
Storing complete log in /home/zjm1126/.pip/pip.log
Was kann ich tun?
aktualisiert:
(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install lxml
Downloading/unpacking lxml
Running setup.py egg_info for package lxml
Building lxml version 2.3.
Building without Cython.
Using build configuration of libxslt 1.1.26
Building against libxml2/libxslt in the following directory: /usr/lib
Installing collected packages: lxml
Running setup.py install for lxml
Building lxml version 2.3.
Building without Cython.
Using build configuration of libxslt 1.1.26
Building against libxml2/libxslt in the following directory: /usr/lib
building 'lxml.etree' extension
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
src/lxml/lxml.etree.c:4: fatal error: Python.h: 没有那个文件或目录
compilation terminated.
error: command 'gcc' failed with exit status 1
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:
Building lxml version 2.3.
Building without Cython.
Using build configuration of libxslt 1.1.26
Building against libxml2/libxslt in the following directory: /usr/lib
running install
running build
running build_py
running build_ext
building 'lxml.etree' extension
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
src/lxml/lxml.etree.c:4: fatal error: Python.h: 没有那个文件或目录
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
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 failed with error code 1
Storing complete log in /home/zjm1126/.pip/pip.log
log:
------------------------------------------------------------
/home/zjm1126/zjm_test/mysite/bin/pip run on Thu Mar 3 17:07:27 2011
Downloading/unpacking mysql-python
Running setup.py egg_info for package mysql-python
running egg_info
creating pip-egg-info/MySQL_python.egg-info
writing pip-egg-info/MySQL_python.egg-info/PKG-INFO
writing top-level names to pip-egg-info/MySQL_python.egg-info/top_level.txt
writing dependency_links to pip-egg-info/MySQL_python.egg-info/dependency_links.txt
writing pip-egg-info/MySQL_python.egg-info/PKG-INFO
writing top-level names to pip-egg-info/MySQL_python.egg-info/top_level.txt
writing dependency_links to pip-egg-info/MySQL_python.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/MySQL_python.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
reading manifest file 'pip-egg-info/MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'MANIFEST'
warning: no files found matching 'ChangeLog'
warning: no files found matching 'GPL'
writing manifest file 'pip-egg-info/MySQL_python.egg-info/SOURCES.txt'
Installing collected packages: mysql-python
Running setup.py install for mysql-python
Running command /home/zjm1126/zjm_test/mysite/bin/python -c "import setuptools;__file__='/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-XuVIux-record/install-record.txt --install-headers /home/zjm1126/zjm_test/mysite/include/site/python2.6
running install
running build
running build_py
creating build
creating build/lib.linux-i686-2.6
copying _mysql_exceptions.py -> build/lib.linux-i686-2.6
creating build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-i686-2.6/MySQLdb
creating build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-i686-2.6/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-i686-2.6
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/include/mysql -I/usr/include/python2.6 -c _mysql.c -o build/temp.linux-i686-2.6/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX
In file included from _mysql.c:29:
pymemcompat.h:10: fatal error: Python.h: 没有那个文件或目录
compilation terminated.
error: command 'gcc' failed with exit status 1
Complete output from command /home/zjm1126/zjm_test/mysite/bin/python -c "import setuptools;__file__='/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-XuVIux-record/install-record.txt --install-headers /home/zjm1126/zjm_test/mysite/include/site/python2.6:
running install
running build
running build_py
creating build
creating build/lib.linux-i686-2.6
copying _mysql_exceptions.py -> build/lib.linux-i686-2.6
creating build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-i686-2.6/MySQLdb
creating build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-i686-2.6/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-i686-2.6
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/include/mysql -I/usr/include/python2.6 -c _mysql.c -o build/temp.linux-i686-2.6/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX
In file included from _mysql.c:29:
pymemcompat.h:10: fatal error: Python.h: 没有那个文件或目录
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command /home/zjm1126/zjm_test/mysite/bin/python -c "import setuptools;__file__='/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-XuVIux-record/install-record.txt --install-headers /home/zjm1126/zjm_test/mysite/include/site/python2.6 failed with error code 1
Exception information:
Traceback (most recent call last):
File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg/pip/basecommand.py", line 130, in main
self.run(options, args)
File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg/pip/commands/install.py", line 228, in run
requirement_set.install(install_options, global_options)
File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg/pip/req.py", line 1043, in install
requirement.install(install_options, global_options)
File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg/pip/req.py", line 559, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg/pip/__init__.py", line 249, in call_subprocess
% (command_desc, proc.returncode))
InstallationError: Command /home/zjm1126/zjm_test/mysite/bin/python -c "import setuptools;__file__='/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-XuVIux-record/install-record.txt --install-headers /home/zjm1126/zjm_test/mysite/include/site/python2.6 failed with error code 1
- Es stellte sich heraus, dass ein Speicher-Problem. Bitte diesen stackoverflow.com/a/26762938/578989
Du musst angemeldet sein, um einen Kommentar abzugeben.
Aus der lxml-Dokumentation, angenommen, Sie führen eine Debian-basierte distribution :
Für Debian-basierte Systeme, sollte es genug, um installieren Sie die bekannten build-Abhängigkeiten von
python-lxml
oderpython3-lxml
z.B.Python.h
fehlen, so installieren Sie python2.6-dev zu:sudo apt-get install python2.6-dev
Dieser arbeitete für mich:
pact install libxslt-devel libxml2-devel
für Babun).error: command 'gcc' failed with exit status 4
auf einem Centos 7 server mit python 3.4 für virtuelle Umgebung. Haben Sie irgendwelche Hinweise? stackoverflow.com/questions/34825789/...sudo apt-get install libxslt-dev
In den Fall, Sie sind mit Ubuntu/Lubuntu 13.04 und Ubuntu 13.10 und habe Probleme mit "/usr/bin/ld: cannot find -lz" ist, müssen Sie möglicherweise auch install zlib1g-dev-Paket:
Setzen Sie alle zusammen:
zlib1g-dev
war die fehlende lib auch für mich, auf Ubuntu 14.04.Nein, Sie fehlen die Python-header-Dateien. Dies geschieht meist auf Linux, wenn Sie den system-Python (es gibt Gründe, das nicht zu tun, aber das ist eine andere Frage).
Müssen Sie wahrscheinlich installieren Sie ein Paket, und es ist wahrscheinlich, genannt python-dev und python-devel.
oder
Oder somesuch.
python2.6-dev
.python3-dev
arbeiten auf Python ist3Ich löste dieses Problem durch die Erhöhung meiner server-ram.
War ich mit nur 512 MB und wenn ich ein Upgrade auf 1 GB hatte ich keine Probleme.
Ich auch installiert jedes Paket manuell vor, um diese in einem Versuch, das problem zu beheben, aber ich bin mir nicht sicher, ob dies ein notwendiger Schritt.
Auf Windows ich hatte den gleichen Fehler unter windows beim Versuch manuell zu installieren, das in Python 3.4, nachdem es installiert wurde auf 3.3. Ich war schließlich in der Lage, es zu lösen, durch die Installation der Rad und laufen pip aus der Python34 Verzeichnis.
1) download Rad von hier: http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
2)
cd Python34\Scripts
3)
pip.exe C:\Users\Home\Downloads\lxml- ......... .whl
pip.exe install C:\Users\<user>\Downloads\lxml-3.6.4-cp35-cp35m-win_amd64.whl
installieren Sie einfach Anforderungen:
Nun, können Sie es mit pip-Paket-management-tool:
Ich bin mit Ubuntu 14.04 und dies löst das Problem für mich
Installation einer lxml binary würde den trick tun. Überprüfen Sie diese
Ich hatte dieses Problem mit pip installieren von lxml. Meine CentOS-Instanz wurde mit python 2.6 wurde das werfen dieser Fehler.
Dies zu umgehen, habe ich Folgendes ausgeführt mit Python 2.7:
sudo yum install python-devel
sudo yum install libxslt-devel libxml2-devel
/usr/bin/python2.7 YOUR_PYTHON_COMMAND
(Für mich war es
/usr/bin/python2.7 -m pip install lxml
)und dann versuchen, ein Upgrade von python-setuptools
sollte dieses Problem beheben.
pymemcompat.h:10: fatal error: Python.h: 没有那个文件或目录
Junge, du solltest deinen post-Fehlerprotokoll mit
LANG=C
oder die Leute können nicht die eigentliche Ursache, aus deinem log. Das log oben sagt: Keine solche Datei oder Verzeichnis.Das bedeutet, dass Sie installieren sollten, die entwickeln Paket von Python. Das ist in der Regel "python-dev" auf Debian gewürzt-Distribution, und "python-devel" auf RHEL gewürzt Distribution.
Alle Antworten oben an, dass der Benutzer hat Zugang zu einem privilegierten/root-account zur Installation der erforderlichen Bibliotheken. Lokal installieren, müssen Sie die folgenden Schritte aus. Nur zeigte der überblick da die Schritte können ein wenig beteiligt, je nach den Abhängigkeiten, die Sie vielleicht fehlt
1.Herunterladen und Kompilieren, libxml2-2.9.1 & libxslt-1.1.28(Versionen ändern könnte)
2.Konfigurieren Sie jeden Installationspfad für beide libxml und libxslt werden einige lokale Verzeichnis, indem Sie konfigurieren. Ex.
./configure --prefix=/home_dir/dependencies/libxslt_path
3.Führen Sie
make
dannmake install
4.Herunterladen und lxml Kompilierung von der Quelle
Dies funktioniert für mich, 12.04, python2.7.6
Ich weiß, ich bin spät, um die show,
Aber dies wird helfen, wenn sonst nichts klappt
TMPDIR-Einstellung wird dafür sorgen, dass der build ausgeführt werden kann alles, was es braucht, um laufen und Einstellung STATIC_DEPS wird Ihnen sagen, Sie ziehen in Ihre eigenen libxml2 und
libxslt2, anstatt die alten Versionen auf dem server installiert.
Verwendung von cygwin 64 mit Windows 8.
Habe ich...
Ich habe alles versucht, bis ich gemerkt habe eine neue cygwin-toolchain Durcheinander gebracht hat python-Logik. cygwin installieren Sie einen compiler namens "realgcc" das ist kein real gcc.
Lösung
Install gcc. Ex:
Das einzige, was half, war für mich
Ich habe den gleichen Fehler auf meinem Linux-Rechner.Wenn Sie gehen, um Ihre website das ist in deren Dokumentation.Also, wenn Sie erhalten diese Art von Fehler in Linux-Maschine, bitte versuchen Sie sich diese Befehle,
# apt install libxml2-dev libxslt-dev python-dev
# pip install lxml==3.4.4
Ich bin mit Ubuntu 12, und das funktioniert für mich:
Wenn Sie installiert haben die libxml2 und libxslt, vielleicht müssen Sie erstellen Sie eine symbolische Verknüpfung zwischen libxml2 und libxslt-Pfad auf python2.6 include-Pfad. Sie können auch versuchen, fügen Sie Umwelt-argument.
Da die gcc-Befehl auf der Suche nach diesem Weg: -I/usr/include/python2.6.
Den unten Datei hat bei mir auf windows
https://pypi.python.org/pypi/lxml/3.3.3#downloads
Auf osx 10.10.5 und in ein virtualenv, vielleicht können Sie das problem zu beheben wie folgt:
Ich arbeite auf einer Windows-Maschine. Und hier sind einige Hinweise für die erfolgreiche installation von lxml (mit python 2.6 und höher).
Folgendes installiert haben:
Alle nicht verfügbar sind, eine
pip install
.libxml2 windows-binary zu finden ist hier.
libxslt gefunden hier.
Nachdem Sie fertig sind mit den beiden oben genannten,
tun :
pip install lxml
.Andere Problemumgehung ist die Verwendung der stabilen Version von PyPI oder die inoffizielle Windows-Binärdateien von Christoph Gohlke (finden Sie hier).
Unter Windows 7 mit Cygwin, stieß ich auf:
Ich es behoben durch die Installation
mingw64-x86_64-libxslt
Für Windows: