python-2.7 - print - python etree lxml
lxml instala en Windows 7 usando pip y python 2.7 (8)
Esta pregunta es más antigua, pero aún aparece en google. Probé las otras respuestas a esta pregunta y no funcionaron por una razón u otra y no quise rastrear e instalar todas las dependencias para compilar en Windows.
Noté que en pypi algunos de los lanzamientos de lxml ofrecen ruedas de ventanas y otros no.
Así que la solución más simple para mí fue especificar una versión que sí ... es decir, pip install lxml==3.6.0
ya que 3.6.0 ofrecía una rueda mientras que el 3.6.4 más nuevo no
Cuando trato de actualizar lxml usando pip en mi máquina con Windows 7, obtengo el registro impreso a continuación.
Cuando desinstalo y trato de instalar desde cero, recibo los mismos errores. ¿Algunas ideas?
Descargar / desempaquetar lxml desde https://pypi.python.org/packages/source/l/lxml/l xml-3.2.4.tar.gz # md5 = cc363499060f615aca1ec8dcc04df331 Descargar lxml-3.2.4.tar.gz (3.3MB) ): Se descargaron 3,3MB Ejecutando setup.py egg_info para el paquete lxml Building lxml version 3.2.4. Construyendo sin Cython. ERROR: Nazwa ''xslt-config'' nie jest rozpoznawana jako polecenie wewnętrzne l ub zewnętrzne, programa wykonywalny lub plik wsadowy.
** make sure the development packages of libxml2 and libxslt are installed *
*
Using build configuration of libxslt D:/software/Python27/lib/distutils/dist.py:267: UserWarning: Unknown distrib ution option: ''bugtrack_url'' warnings.warn(msg) warning: no files found matching ''lxml.etree.c'' under directory ''src/lxml'' warning: no files found matching ''lxml.objectify.c'' under directory ''src/lxm l'' warning: no files found matching ''lxml.etree.h'' under directory ''src/lxml'' warning: no files found matching ''lxml.etree_api.h'' under directory ''src/lxm l'' warning: no files found matching ''etree_defs.h'' under directory ''src/lxml'' warning: no files found matching ''*.txt'' under directory ''src/lxml/tests'' warning: no files found matching ''pubkey.asc'' under directory ''doc'' warning: no files found matching ''tagpython*.png'' under directory ''doc'' warning: no files found matching ''Makefile'' under directory ''doc'' Installing collected packages: lxml Found existing installation:
lxml 2.3 Desinstalar lxml: se desinstaló correctamente lxml Ejecución de setup.py install para lxml Building lxml versión 3.2.4. Construyendo sin Cython. ERROR: Nazwa ''xslt-config'' nie jest rozpoznawana jako polecenie wewnętrzne l ub zewnętrzne, programa wykonywalny lub plik wsadowy.
** make sure the development packages of libxml2 and libxslt are installed *
*
Using build configuration of libxslt building ''lxml.etree'' extension D:/software/Microsoft Visual Studio 9.0/VC/BIN/cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG
-Ic: / users / x / appdata / local / temp / pip_build_x / lxml / src / lxml / inc ludes -ID: / software / Python27 / include -ID: / software / Python27 / PC / Tcsrc / lxml / lxml. etree.c /Fobuild/temp.win32-2.7/Release/src/lxml/lxml.etree.obj lxml.etree.cc: / users / x / appdata / local / temp / pip_build_x / lxml / src / lxml / includes / etree_d efs.h (9): error fatal C1083: No se puede abrir el archivo de inclusión: ''libxml / xmlversion.h'': N o dicho archivo o directorio D: / software / Python27 / lib / distutils / dist.py: 267: UserWarning: Opción de distribución desconocida: ''bugtrack_url'' warnings.warn (msg) error: comando ''"D: / software / Microsoft Visual Studio 9.0 / VC / BIN / cl.exe"'' fai led con estado de salida 2 Salida completa del comando D: / software / Python27 / python.exe -c "importar setu ptools; archivo = ''c: / usuarios / x / appdata / local / temp / pip_build_x / lxml / setu p.py''; exec (compilar (abrir ( archivo ). read (). replace (''/ r / n'', ''/ n''), archivo , ''exec'')) "install --record c: / users / x / appdata / local / temp / pip-pyyuss-record / install-r ecord.txt --single-version-externally-managed: construyendo lxml versión 3.2.4.
Construyendo sin Cython.
ERROR: Nazwa ''xslt-config'' nie jest rozpoznawana jako polecenie wewnętrzne lub z ewnętrzne,
programa wykonywalny lub plik wsadowy.
** asegúrese de que los paquetes de desarrollo de libxml2 y libxslt estén instalados **
Usando la configuración de compilación de libxslt
ejecutando la instalación
ejecutando compilación
corriendo build_py
creando construcción
creando build / lib.win32-2.7
creando build / lib.win32-2.7 / lxml
copiando src / lxml / builder.py -> build / lib.win32-2.7 / lxml
copiando src / lxml / cssselect.py -> build / lib.win32-2.7 / lxml
copiando src / lxml / doctestcompare.py -> build / lib.win32-2.7 / lxml
copiando src / lxml / ElementInclude.py -> build / lib.win32-2.7 / lxml
copiando src / lxml / pyclasslookup.py -> build / lib.win32-2.7 / lxml
copiando src / lxml / sax.py -> build / lib.win32-2.7 / lxml
copiando src / lxml / usedoctest.py -> build / lib.win32-2.7 / lxml
copiando src / lxml_elementpath.py -> build / lib.win32-2.7 / lxml
copiando src / lxml__init __. py -> build / lib.win32-2.7 / lxml
creando build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes__init __. py -> build / lib.win32-2.7 / lxml / includes
creando build / lib.win32-2.7 / lxml / html
copiando src / lxml / html / builder.py -> build / lib.win32-2.7 / lxml / html
copiando src / lxml / html / clean.py -> build / lib.win32-2.7 / lxml / html
copiando src / lxml / html / def.py -> build / lib.win32-2.7 / lxml / html
copiando src / lxml / html / diff.py -> build / lib.win32-2.7 / lxml / html
copiando src / lxml / html / ElementSoup.py -> build / lib.win32-2.7 / lxml / html
copiando src / lxml / html / formfill.py -> build / lib.win32-2.7 / lxml / html
copiando src / lxml / html / html5parser.py -> build / lib.win32-2.7 / lxml / html
copiando src / lxml / html / soupparser.py -> build / lib.win32-2.7 / lxml / html
copiando src / lxml / html / usedoctest.py -> build / lib.win32-2.7 / lxml / html
copiando src / lxml / html_diffcommand.py -> build / lib.win32-2.7 / lxml / html
copiando src / lxml / html_html5builder.py -> build / lib.win32-2.7 / lxml / html
copiando src / lxml / html_setmixin.py -> build / lib.win32-2.7 / lxml / html
copiando src / lxml / html__init __. py -> build / lib.win32-2.7 / lxml / html
creando build / lib.win32-2.7 / lxml / isoschematron
copiando src / lxml / isoschematron__init __. py -> build / lib.win32-2.7 / lxml / isoschema tron
copiando src / lxml / lxml.etree.h -> build / lib.win32-2.7 / lxml
copiando src / lxml / lxml.etree_api.h -> build / lib.win32-2.7 / lxml
copiando src / lxml / includes / c14n.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / config.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / dtdvalid.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / etreepublic.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / htmlparser.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / relaxng.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / schematron.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / tree.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / uri.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / xinclude.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / xmlerror.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / xmlparser.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / xmlschema.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / xpath.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / xslt.pxd -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / etree_defs.h -> build / lib.win32-2.7 / lxml / includes
copiando src / lxml / includes / lxml-version.h -> build / lib.win32-2.7 / lxml / includes
creando build / lib.win32-2.7 / lxml / isoschematron / resources
creando build / lib.win32-2.7 / lxml / isoschematron / resources / rng
copiando src / lxml / isoschematron / resources / rng / iso-schematron.rng -> build / lib.win 32-2.7 / lxml / isoschematron / resources / rng
creando build / lib.win32-2.7 / lxml / isoschematron / resources / xsl
copiando src / lxml / isoschematron / resources / xsl / RNG2Schtrn.xsl -> build / lib.win32-2 .7 / lxml / isoschematron / resources / xsl
copiando src / lxml / isoschematron / resources / xsl / XSD2Schtrn.xsl -> build / lib.win32-2 .7 / lxml / isoschematron / resources / xsl
creando compilación / lib.win32-2.7 / lxml / isoschematron / resources / xsl / iso-schematron-xsl t1
copiando src / lxml / isoschematron / resources / xsl / iso-schematron-xslt1 / iso_abstract_e xpand.xsl -> build / lib.win32-2.7 / lxml / isoschematron / resources / xsl / iso-schematron -xslt1
copiando src / lxml / isoschematron / resources / xsl / iso-schematron-xslt1 / iso_dsdl_inclu de.xsl -> build / lib.win32-2.7 / lxml / isoschematron / resources / xsl / iso-schematron-xs lt1
copiando src / lxml / isoschematron / resources / xsl / iso-schematron-xslt1 / iso_schematron _message.xsl -> build / lib.win32-2.7 / lxml / isoschematron / resources / xsl / iso-schemat ron-xslt1
copiando src / lxml / isoschematron / resources / xsl / iso-schematron-xslt1 / iso_schematron _skeleton_for_xslt1.xsl -> build / lib.win32-2.7 / lxml / isoschematron / resources / xsl / iso-schematron-xslt1
copiando src / lxml / isoschematron / resources / xsl / iso-schematron-xslt1 / iso_svrl_for_x slt1.xsl -> build / lib.win32-2.7 / lxml / isoschematron / resources / xsl / iso-schematron- xslt1
copiando src / lxml / isoschematron / resources / xsl / iso-schematron-xslt1 / readme.txt -> build / lib.win32-2.7 / lxml / isoschematron / resources / xsl / iso-schematron-xslt1
corriendo build_ext
construir la extensión ''lxml.etree''
creando build / temp.win32-2.7
creando build / temp.win32-2.7 / Release
creando build / temp.win32-2.7 / Release / src
creando build / temp.win32-2.7 / Release / src / lxml
D: / software / Microsoft Visual Studio 9.0 / VC / BIN / cl.exe / c / nologo / Ox / MD / W3 / GS - / DNDEBUG - Ic: / users / x / appdata / local / temp / pip_build_x / lxml / src / lxml / include s -ID: / software / Python27 / include -ID: / software / Python27 / PC /Tcsrc/lxml/lxml.etre ec /Fobuild/temp.win32-2.7/Release/src/lxml/lxml. etree.obj
lxml.etree.c
c: / users / x / appdata / local / temp / pip_build_x / lxml / src / lxml / includes / etree_defs. h (9): error fatal C1083: no se puede abrir el archivo de inclusión: ''libxml / xmlversion.h'': ningún archivo o directorio su ch
D: / software / Python27 / lib / distutils / dist.py: 267: UserWarning: opción de distribución desconocida: ''bugtrack_url''
warnings.warn (msg)
error: el comando ''"D: / software / Microsoft Visual Studio 9.0 / VC / BIN / cl.exe"'' falló con el estado de salida 2
---------------------------------------- Revertir la desinstalación de lxml Limpiar ... Comando D: / software / Python27 / python.exe -c "importar setuptools; archivo = ''c: / usuario s / x / appdata / local / temp / pip_build_x / lxml / setup.py''; exec (compilar (abrir (_ archivo _). read (). replace (''/ r / n'', ''/ n''), archivo , ''exec'')) "install --record c: / u sers / x / appdata / local / temp / pip -pyyuss-record / install-record.txt --single-versio n-externally-managed falló con el código de error 1 en c: / users / x / appdata / local / temp / pip_build_x / lxml Traceback (última llamada más reciente): Archivo "D: / software / Python27 / Scripts / pip-script.py", línea 9, en load_entry_point (''pip == 1.4.1'', ''console_scripts'', ''pip'') () Archivo "D: / software /" Python27 / lib / site-packages / pip__init __. Py ", línea 148, en ma en return command.main (args [1:], options) Archivo" D: / software / Python27 / lib / site-packages / pip / basecommand .py ", línea 169, en texto principal = ''/ n''.join (complete_log) UnicodeDecodeError: el códec'' ascii ''no puede decodificar el byte 0xa9 en la posición 72: el ordinal no está dentro del rango (128)
He instalado (VS C ++ 2014 Express) Falló la instalación directa de pip, pero después de agregar los siguientes elementos prestados de Fernando Macedo establecí STATICBUILD = true && pip install lxml esto funcionó para mí en virtualenv en Windows 10 con Python 3.5.2, lxml 3.6.4
-tag cp35:
Building lxml version 3.6.4.
Building without Cython.
ERROR: b"''xslt-config'' is not recognized as an internal or external command,/r/noperable program or batch file./r/n"
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
running bdist_wheel
running build
running build_py
creating build
creating build/lib.win32-3.5
creating build/lib.win32-3.5/lxml
copying src/lxml/builder.py -> build/lib.win32-3.5/lxml
copying src/lxml/cssselect.py -> build/lib.win32-3.5/lxml
copying src/lxml/doctestcompare.py -> build/lib.win32-3.5/lxml
copying src/lxml/ElementInclude.py -> build/lib.win32-3.5/lxml
copying src/lxml/pyclasslookup.py -> build/lib.win32-3.5/lxml
copying src/lxml/sax.py -> build/lib.win32-3.5/lxml
copying src/lxml/usedoctest.py -> build/lib.win32-3.5/lxml
copying src/lxml/_elementpath.py -> build/lib.win32-3.5/lxml
copying src/lxml/__init__.py -> build/lib.win32-3.5/lxml
creating build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.win32-3.5/lxml/includes
creating build/lib.win32-3.5/lxml/html
copying src/lxml/html/builder.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/clean.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/defs.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/diff.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/formfill.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/__init__.py -> build/lib.win32-3.5/lxml/html
creating build/lib.win32-3.5/lxml/isoschematron
copying src/lxml/isoschematron/__init__.py -> build/lib.win32- 3.5/lxml/isoschematron
copying src/lxml/lxml.etree.h -> build/lib.win32-3.5/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.win32-3.5/lxml
copying src/lxml/includes/c14n.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/relaxng.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/schematron.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.win32-3.5/lxml/includes
creating build/lib.win32-3.5/lxml/isoschematron/resources
creating build/lib.win32-3.5/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.win32-3.5/lxml/isoschematron/resources/rng
creating build/lib.win32-3.5/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl
creating build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building ''lxml.etree'' extension
creating build/temp.win32-3.5
creating build/temp.win32-3.5/Release
creating build/temp.win32-3.5/Release/src
creating build/temp.win32-3.5/Release/src/lxml
C:/Program Files/Microsoft Visual Studio 14.0/VC/BIN/cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Isrc/lxml/includes "-Ic:/program files/python35-32/include" "-Ic:/program files/python35-32/include" "-IC:/Program Files/Microsoft Visual Studio 14.0/VC/INCLUDE" "-IC:/Program Files/Microsoft Visual Studio 14.0/VC/ATLMFC/INCLUDE" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/ucrt" "-IC:/Program Files/Windows Kits/NETFXSDK/4.6.1/include/um" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/shared" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/um" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/winrt" /Tcsrc/lxml/lxml.etree.c /Fobuild/temp.win32-3.5/Release/src/lxml/lxml.etree.obj -w
cl : Command line warning D9025 : overriding ''/W3'' with ''/w''
lxml.etree.c
src/lxml/includes/etree_defs.h(14): fatal error C1083: Cannot open include file: ''libxml/xmlversion.h'': No such file or directory
Compile failed: command ''C://Program Files//Microsoft Visual Studio 14.0//VC//BIN//cl.exe'' failed with exit status 2
creating Users
creating Users/DDSHARMA
creating Users/DDSHARMA/AppData
creating Users/DDSHARMA/AppData/Local
creating Users/DDSHARMA/AppData/Local/Temp
C:/Program Files/Microsoft Visual Studio 14.0/VC/BIN/cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/include/libxml2 "-IC:/Program Files/Microsoft Visual Studio 14.0/VC/INCLUDE" "-IC:/Program Files/Microsoft Visual Studio 14.0/VC/ATLMFC/INCLUDE" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/ucrt" "-IC:/Program Files/Windows Kits/NETFXSDK/4.6.1/include/um" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/shared" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/um" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/winrt" /TcC:/Users/DDSHARMA/AppData/Local/Temp/xmlXPathInitsaig9hq_.c /FoUsers/DDSHARMA/AppData/Local/Temp/xmlXPathInitsaig9hq_.obj
xmlXPathInitsaig9hq_.c
C:/Users/DDSHARMA/AppData/Local/Temp/xmlXPathInitsaig9hq_.c(1): fatal error C1083: Cannot open include file: ''libxml/xpath.h'': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command ''C://Program Files//Microsoft Visual Studio 14.0//VC//BIN//cl.exe'' failed with exit status 2
----------------------------------------
Failed building wheel for lxml
Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml
Running setup.py install for lxml ... error
Complete output from command c:/users/ddsharma/documents/pymote_env/scripts/python.exe -u -c "import setuptools, tokenize;__file__=''C://Users//DDSHARMA//AppData//Local//Temp//pip-build-gtry8727//lxml//setup.py'';exec(compile(getattr(tokenize, ''open'', open)(__file__).read().replace(''/r/n'', ''/n''), __file__, ''exec''))" install --record C:/Users/DDSHARMA/AppData/Local/Temp/pip-waqsvkju-record/install-record.txt --single-version-externally-managed --compile --install-headers c:/users/ddsharma/documents/pymote_env/include/site/python3.5/lxml:
Building lxml version 3.6.4.
Building without Cython.
ERROR: b"''xslt-config'' is not recognized as an internal or external command,/r/noperable program or batch file./r/n"
** 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 build/lib.win32-3.5
creating build/lib.win32-3.5/lxml
copying src/lxml/builder.py -> build/lib.win32-3.5/lxml
copying src/lxml/cssselect.py -> build/lib.win32-3.5/lxml
copying src/lxml/doctestcompare.py -> build/lib.win32-3.5/lxml
copying src/lxml/ElementInclude.py -> build/lib.win32-3.5/lxml
copying src/lxml/pyclasslookup.py -> build/lib.win32-3.5/lxml
copying src/lxml/sax.py -> build/lib.win32-3.5/lxml
copying src/lxml/usedoctest.py -> build/lib.win32-3.5/lxml
copying src/lxml/_elementpath.py -> build/lib.win32-3.5/lxml
copying src/lxml/__init__.py -> build/lib.win32-3.5/lxml
creating build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.win32-3.5/lxml/includes
creating build/lib.win32-3.5/lxml/html
copying src/lxml/html/builder.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/clean.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/defs.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/diff.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/formfill.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.win32-3.5/lxml/html
copying src/lxml/html/__init__.py -> build/lib.win32-3.5/lxml/html
creating build/lib.win32-3.5/lxml/isoschematron
copying src/lxml/isoschematron/__init__.py -> build/lib.win32-3.5/lxml/isoschematron
copying src/lxml/lxml.etree.h -> build/lib.win32-3.5/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.win32-3.5/lxml
copying src/lxml/includes/c14n.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/relaxng.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/schematron.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.win32-3.5/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.win32-3.5/lxml/includes
creating build/lib.win32-3.5/lxml/isoschematron/resources
creating build/lib.win32-3.5/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.win32-3.5/lxml/isoschematron/resources/rng
creating build/lib.win32-3.5/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl
creating build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.win32-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building ''lxml.etree'' extension
creating build/temp.win32-3.5
creating build/temp.win32-3.5/Release
creating build/temp.win32-3.5/Release/src
creating build/temp.win32-3.5/Release/src/lxml
C:/Program Files/Microsoft Visual Studio 14.0/VC/BIN/cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Isrc/lxml/includes "-Ic:/program files/python35-32/include" "-Ic:/program files/python35-32/include" "-IC:/Program Files/Microsoft Visual Studio 14.0/VC/INCLUDE" "-IC:/Program Files/Microsoft Visual Studio 14.0/VC/ATLMFC/INCLUDE" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/ucrt" "-IC:/Program Files/Windows Kits/NETFXSDK/4.6.1/include/um" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/shared" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/um" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/winrt" /Tcsrc/lxml/lxml.etree.c /Fobuild/temp.win32-3.5/Release/src/lxml/lxml.etree.obj -w
cl : Command line warning D9025 : overriding ''/W3'' with ''/w''
lxml.etree.c
src/lxml/includes/etree_defs.h(14): fatal error C1083: Cannot open include file: ''libxml/xmlversion.h'': No such file or directory
Compile failed: command ''C://Program Files//Microsoft Visual Studio 14.0//VC//BIN//cl.exe'' failed with exit status 2
C:/Program Files/Microsoft Visual Studio 14.0/VC/BIN/cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/include/libxml2 "-IC:/Program Files/Microsoft Visual Studio 14.0/VC/INCLUDE" "-IC:/Program Files/Microsoft Visual Studio 14.0/VC/ATLMFC/INCLUDE" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/ucrt" "-IC:/Program Files/Windows Kits/NETFXSDK/4.6.1/include/um" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/shared" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/um" "-IC:/Program Files/Windows Kits/10/include/10.0.14393.0/winrt" /TcC:/Users/DDSHARMA/AppData/Local/Temp/xmlXPathInit1y_w6myc.c /FoUsers/DDSHARMA/AppData/Local/Temp/xmlXPathInit1y_w6myc.obj
xmlXPathInit1y_w6myc.c
C:/Users/DDSHARMA/AppData/Local/Temp/xmlXPathInit1y_w6myc.c(1): fatal error C1083: Cannot open include file: ''libxml/xpath.h'': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command ''C://Program Files//Microsoft Visual Studio 14.0//VC//BIN//cl.exe'' failed with exit status 2
----------------------------------------
Command "c:/users/ddsharma/documents/pymote_env/scripts/python.exe -u -c "import setuptools, tokenize;__file__=''C://Users//DDSHARMA//AppData//Local//Temp//pip-build-gtry8727//lxml//setup.py'';exec(compile(getattr(tokenize, ''open'', open)(__file__).read().replace(''/r/n'', ''/n''), __file__, ''exec''))" install --record C:/Users/DDSHARMA/AppData/Local/Temp/pip-waqsvkju-record/install-record.txt --single-version-externally-managed --compile --install-headers c:/users/ddsharma/documents/pymote_env/include/site/python3.5/lxml" failed with error code 1 in C:/Users/DDSHARMA/AppData/Local/Temp/pip-build-gtry8727/lxml/
(pymote_env) C:/Users/DDSHARMA/Documents/pymote_env>set STATICBUILD=true && pip install lxml
Collecting lxml
Using cached lxml-3.6.4.tar.gz
Building wheels for collected packages: lxml
Running setup.py bdist_wheel for lxml ... done
Stored in directory: C:/Users/DDSHARMA/AppData/Local/pip/Cache/wheels/c6/ad/ad/cd812eeb1e0e179b58d92b1e8bad7accd136f51b5d812fd495
Successfully built lxml
Installing collected packages: lxml
Successfully installed lxml-3.6.4
(pymote_env) C:/Users
/ DDSHARMA / Documents / pymote_env>
Las preguntas frecuentes en el sitio web lxml apuntan a un sitio que amablemente ha creado distribuciones binarias para Windows:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
la rueda se puede instalar usando pip.
https://pip.pypa.io/en/latest/user_guide/#installing-from-wheels
pip install lxml‑3.5.0‑cp27‑none‑win32.whl
Necesita instalar libxml, libxslt, libiconv y zlib en su entorno virtual. También necesita VS 2008, porque Python 2.7 está compilado contra esa versión. Escribí una explicación más detallada aquí http://www.laurivan.com/install-lxml-on-windows-on-a-virtualenv/
Para su problema, hay una sola solución de línea. De alguna manera, esto está funcionando significa que estás haciendo raspado a bajo nivel, entonces esto funcionará.
Después de 8 horas de investigación, encontré que esto no funcionaba más
pip install lxml==3.6.0
No se requiere nada más.
Todas las cosas anteriores son aplicables para Windows.
Comente si persiste algún otro tipo de problema, feliz de ayudar.
Aquí está mi éxito después de 8 horas:
Puede seguir los pasos de la respuesta de Flak , o simplemente puede descargar el instalador de Windows , hacer doble clic para abrirlo y seguir su camino.
Si tiene un compilador instalado (probado con VS C ++ 2008 Express), simplemente puede ejecutar:
set STATICBUILD=true && pip install lxml
Como se señala en la documentación , al configurar STATICBUILD
le indicará al instalador de lxml que descargue automáticamente todas sus dependencias binarias antes de la compilación.
Estas dependencias binarias lxml
, que deberían estar presentes cuando se instalan desde el origen, serán descargadas y compiladas juntas por el instalador:
- libxslt
- iconv
- zlib
- libxml2
Bonificación : también funciona dentro de un virtualenv.
Estas instrucciones son para Windows7 o Windows8 con Python2.7 .
Sin embargo , deberían funcionar para varias versiones a medida que cambian / evolucionan las versiones de python y otros requisitos previos respectivos:
- Instalar Python2.7 :
- Descargue la última versión de Python2.7 (actualmente 2.7.6) desde la página de descargas HERE
- Simplemente ejecute el MSI para instalar Python. Se registrará en el registro y aparecerá en Agregar / REmanterar programas.
- NOTA: mis instrucciones que siguen suponen que elige instalar Python en la ruta predeterminada de
C:/python27/
cuando se le pregunta durante el Asistente de instalación de Python
- Agregue las
C:/python27/
yC:/python27/scripts
a la ruta del sistema agregando esos directorios a laPATH
entornoPATH
desde el Panel de control> Sistema> Configuración avanzada del sistema (pestaña Avanzado)> Variables ambientales (botón) . - (OPCIONAL) Instalar OpenSSL :
- Descargue la página Win32 OpenSSL desde HERE para su versión de la arquitectura de Windows y PC
- Descargue los redistribuibles de Visual C ++ 2008 para su versión de la arquitectura de Windows y PC
- Descargue OpenSSL para su versión de Windows y arquitectura (la versión regular, no la ligera)
- Agregue el siguiente directorio (según su arquitectura) (o donde sea que se encuentre) a su
PATH
, de la misma forma en que agregóC:/python27
yC:/python27/scripts
arriba:- 32 bits:
c:/openssl-win32/bin
- 64 bits:
c:/openssl-win64/bin
- 32 bits:
- Instale Setuptools (
get-pip.py
debería instalar Setuptools para usted), pero, por si acaso ...- Descargue
ez_setup.py
HERE y guárdelo enC:/python27/scripts
- Ejecute
C:/python27/scripts> python ez_setup.py
- Descargue
- Instalar PIP
- Descargue
get-pip.py
desde HERE y guárdelo enC:/python27/scripts
- Ejecute
C:/python27/scripts> python get-pip.py
- Descargue
- Instalar LXML
- Descargue
LXML 3.3.3
de HERE para su versión de la arquitectura de Windows y PC - Ejecute el archivo EXE
- Descargue