/ / Lxml für Python verwenden - Windows 7 64-Bit - Python, Windows, Lxml

Verwenden von Lxml für Python - Windows 7 64-Bit - Python, Windows, Lxml

Wenn ich versuche, lxml zu installieren, erhalte ich Folgendes. Ich habe versucht, C ++ - Redisten herunterzuladen, und eine ganze Reihe anderer Dinge, die ich gefunden habe, aber nichts funktioniert.

Ich habe alles aus folgendem Link ausprobiert:

Wie installiere ich lxml unter Windows?

Ich habe Python-Version 3.5.1

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:Usersdaniel.bak>pip install setuptools
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:usersdaniel.bakappdatalocalprogramspythonpython35-32libsite-packages

C:Usersdaniel.bak>pip install lxml
Collecting lxml
Using cached lxml-3.6.0.tar.gz
Installing collected packages: lxml
Running setup.py install for lxml ... error
Complete output from command c:usersdaniel.bakappdatalocalprogramspythonpython35-32python.exe -u -c "import setuptools, tokenize;__file__="C:\Users\daniel.bak\AppData\Local\Temp\pip-build-_d7bp49n\lxml\setup.py";exec(compile(getattr(tokenize, "open", open)(__file__).read().replac
e("rn", "n"), __file__, "exec"))" install --record C:Usersdaniel.bakAppDataLocalTemppip-4wmqb1li-recordinstall-record.txt --single-version-externally-managed --compile:
Building lxml version 3.6.0.
Building without Cython.
ERROR: b""xslt-config" is not recognized as an internal or external command,rnoperable program or batch file.rn"
** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
running install
running build
running build_py
creating build
creating buildlib.win32-3.5
creating buildlib.win32-3.5lxml
copying srclxmlbuilder.py -> buildlib.win32-3.5lxml
copying srclxmlcssselect.py -> buildlib.win32-3.5lxml
copying srclxmldoctestcompare.py -> buildlib.win32-3.5lxml
copying srclxmlElementInclude.py -> buildlib.win32-3.5lxml
copying srclxmlpyclasslookup.py -> buildlib.win32-3.5lxml
copying srclxmlsax.py -> buildlib.win32-3.5lxml
copying srclxmlusedoctest.py -> buildlib.win32-3.5lxml
copying srclxml_elementpath.py -> buildlib.win32-3.5lxml
copying srclxml__init__.py -> buildlib.win32-3.5lxml
creating buildlib.win32-3.5lxmlincludes
copying srclxmlincludes__init__.py -> buildlib.win32-3.5lxmlincludes
creating buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlbuilder.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlclean.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmldefs.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmldiff.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlElementSoup.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlformfill.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlhtml5parser.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlsoupparser.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlusedoctest.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtml_diffcommand.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtml_html5builder.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtml_setmixin.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtml__init__.py -> buildlib.win32-3.5lxmlhtml
creating buildlib.win32-3.5lxmlisoschematron
copying srclxmlisoschematron__init__.py -> buildlib.win32-3.5lxmlisoschematron
copying srclxmllxml.etree.h -> buildlib.win32-3.5lxml
copying srclxmllxml.etree_api.h -> buildlib.win32-3.5lxml
copying srclxmlincludesc14n.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesconfig.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesdtdvalid.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesetreepublic.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludeshtmlparser.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesrelaxng.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesschematron.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludestree.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesuri.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesxinclude.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesxmlerror.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesxmlparser.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesxmlschema.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesxpath.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesxslt.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesetree_defs.h -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludeslxml-version.h -> buildlib.win32-3.5lxmlincludes
creating buildlib.win32-3.5lxmlisoschematronresources
creating buildlib.win32-3.5lxmlisoschematronresourcesrng
copying srclxmlisoschematronresourcesrngiso-schematron.rng -> buildlib.win32-3.5lxmlisoschematronresourcesrng
creating buildlib.win32-3.5lxmlisoschematronresourcesxsl
copying srclxmlisoschematronresourcesxslRNG2Schtrn.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsl
copying srclxmlisoschematronresourcesxslXSD2Schtrn.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsl
creating buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_abstract_expand.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_dsdl_include.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_schematron_message.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_schematron_skeleton_for_xslt1.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_svrl_for_xslt1.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1readme.txt -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1
running build_ext
building "lxml.etree" extension
error: Unable to find vcvarsall.bat

----------------------------------------
Command "c:usersdaniel.bakappdatalocalprogramspythonpython35-32python.exe -u -c "import setuptools, tokenize;__file__="C:\Users\daniel.bak\AppData\Local\Temp\pip-build-_d7bp49n\lxml\setup.py";exec(compile(getattr(tokenize, "open", open)(__file__).read().replace("rn", "n"), __file_
_, "exec"))" install --record C:Usersdaniel.bakAppDataLocalTemppip-4wmqb1li-recordinstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:Usersdaniel.bakAppDataLocalTemppip-build-_d7bp49nlxml

Das Installieren der vorkompilierten Binärdateien gibt mir Folgendes:

C:Usersdaniel.bak>pip install "C:Usersdaniel.bakDownloadslxml-3.6.0-cp35-cp35m-win_amd64.whl"
lxml-3.6.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.

Antworten:

2 für die Antwort № 1

Sie können vorkompilierte Binärdateien herunterladen und mit installieren pip install

Hier ist das Download-Link. cp27, cp34, cp35 geben Sie Python-Versionen und an win32 und win_amd64 32 und 64-Bit-Pakete.


-1 für die Antwort № 2

Ich hatte Probleme beim Installieren von lxml auf meinem Systemauch zusammen mit urllib. Ich kann mich nicht erinnern warum, aber Lxml war nicht für Python 3.5 verfügbar, urllib selbst ist nicht verfügbar, sondern als urllib.requests und ein anderes Paket, an das ich mich nicht erinnere. Für mich war die beste Lösung, stattdessen Anaconda zu installieren. Anaconda hat einfach so viele Bibliotheken und funktioniert statt Python. Es hat die gesamte URL-Bibliothek und ein Verständnis für mehrere andere Bibliotheken.