I'm trying to install lmxl
on my Windows 8.1 laptop with Python 3.4 and failing miserably.
First off, I tried the simple and obvious solution: pip install lxml
. However, this didn't work. Here's what it said:
Downloading/unpacking lxml
Running setup.py (path:C:UsersCARTE_~1AppDataLocalTemppip_build_carte_000lxmlsetup.py) egg_info for package lxml
Building lxml version 3.4.2.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,
operable program or batch file.
"
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
C:Python34libdistutilsdist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
warning: no previously-included files found matching '*.py'
Installing collected packages: lxml
Running setup.py install for lxml
Building lxml version 3.4.2.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,
operable program or batch file.
"
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
building 'lxml.etree' extension
C:Python34libdistutilsdist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
error: Unable to find vcvarsall.bat
Complete output from command C:Python34python.exe -c "import setuptools, tokenize;__file__='C:\Users\CARTE_~1\AppData\Local\Temp\pip_build_carte_000\lxml\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('
', '
'), __file__, 'exec'))" install --record C:UsersCARTE_~1AppDataLocalTemppip-l8vvrv9g-recordinstall-record.txt --single-version-externally-managed --compile:
Building lxml version 3.4.2.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,
operable program or batch file.
"
** 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.4
creating buildlib.win32-3.4lxml
copying srclxmluilder.py -> buildlib.win32-3.4lxml
copying srclxmlcssselect.py -> buildlib.win32-3.4lxml
copying srclxmldoctestcompare.py -> buildlib.win32-3.4lxml
copying srclxmlElementInclude.py -> buildlib.win32-3.4lxml
copying srclxmlpyclasslookup.py -> buildlib.win32-3.4lxml
copying srclxmlsax.py -> buildlib.win32-3.4lxml
copying srclxmlusedoctest.py -> buildlib.win32-3.4lxml
copying srclxml\_elementpath.py -> buildlib.win32-3.4lxml
copying srclxml\__init__.py -> buildlib.win32-3.4lxml
creating buildlib.win32-3.4lxmlincludes
copying srclxmlincludes\__init__.py -> buildlib.win32-3.4lxmlincludes
creating buildlib.win32-3.4lxmlhtml
copying srclxmlhtmluilder.py -> buildlib.win32-3.4lxmlhtml
copying srclxmlhtmlclean.py -> buildlib.win32-3.4lxmlhtml
copying srclxmlhtmldefs.py -> buildlib.win32-3.4lxmlhtml
copying srclxmlhtmldiff.py -> buildlib.win32-3.4lxmlhtml
copying srclxmlhtmlElementSoup.py -> buildlib.win32-3.4lxmlhtml
copying srclxmlhtmlformfill.py -> buildlib.win32-3.4lxmlhtml
copying srclxmlhtmlhtml5parser.py -> buildlib.win32-3.4lxmlhtml
copying srclxmlhtmlsoupparser.py -> buildlib.win32-3.4lxmlhtml
copying srclxmlhtmlusedoctest.py -> buildlib.win32-3.4lxmlhtml
copying srclxmlhtml\_diffcommand.py -> buildlib.win32-3.4lxmlhtml
copying srclxmlhtml\_html5builder.py -> buildlib.win32-3.4lxmlhtml
copying srclxmlhtml\_setmixin.py -> buildlib.win32-3.4lxmlhtml
copying srclxmlhtml\__init__.py -> buildlib.win32-3.4lxmlhtml
creating buildlib.win32-3.4lxmlisoschematron
copying srclxmlisoschematron\__init__.py -> buildlib.win32-3.4lxmlisoschematron
copying srclxmllxml.etree.h -> buildlib.win32-3.4lxml
copying srclxmllxml.etree_api.h -> buildlib.win32-3.4lxml
copying srclxmlincludesc14n.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesconfig.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesdtdvalid.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesetreepublic.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludeshtmlparser.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludes
elaxng.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesschematron.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesree.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesuri.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesxinclude.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesxmlerror.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesxmlparser.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesxmlschema.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesxpath.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesxslt.pxd -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludesetree_defs.h -> buildlib.win32-3.4lxmlincludes
copying srclxmlincludeslxml-version.h -> buildlib.win32-3.4lxmlincludes
creating buildlib.win32-3.4lxmlisoschematron
esources
creating buildlib.win32-3.4lxmlisoschematron
esources
ng
copying srclxmlisoschematron
esources
ngiso-schematron.rng -> buildlib.win32-3.4lxmlisoschematron
esources
ng
creating buildlib.win32-3.4lxmlisoschematron
esourcesxsl
copying srclxmlisoschematron
esourcesxslRNG2Schtrn.xsl -> buildlib.win32-3.4lxmlisoschematron
esourcesxsl
copying srclxmlisoschematron
esourcesxslXSD2Schtrn.xsl -> buildlib.win32-3.4lxmlisoschematron
esourcesxsl
creating buildlib.win32-3.4lxmlisoschematron
esourcesxsliso-schematron-xslt1
copying srclxmlisoschematron
esourcesxsliso-schematron-xslt1iso_abstract_expand.xsl -> buildlib.win32-3.4lxmlisoschematron
esourcesxsliso-schematron-xslt1
copying srclxmlisoschematron
esourcesxsliso-schematron-xslt1iso_dsdl_include.xsl -> buildlib.win32-3.4lxmlisoschematron
esourcesxsliso-schematron-xslt1
copying srclxmlisoschematron
esourcesxsliso-schematron-xslt1iso_schematron_message.xsl -> buildlib.win32-3.4lxmlisoschematron
esourcesxsliso-schematron-xslt1
copying srclxmlisoschematron
esourcesxsliso-schematron-xslt1iso_schematron_skeleton_for_xslt1.xsl -> buildlib.win32-3.4lxmlisoschematron
esourcesxsliso-schematron-xslt1
copying srclxmlisoschematron
esourcesxsliso-schematron-xslt1iso_svrl_for_xslt1.xsl -> buildlib.win32-3.4lxmlisoschematron
esourcesxsliso-schematron-xslt1
copying srclxmlisoschematron
esourcesxsliso-schematron-xslt1
eadme.txt -> buildlib.win32-3.4lxmlisoschematron
esourcesxsliso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
C:Python34libdistutilsdist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
error: Unable to find vcvarsall.bat
----------------------------------------
Cleaning up...
Command C:Python34python.exe -c "import setuptools, tokenize;__file__='C:\Users\CARTE_~1\AppData\Local\Temp\pip_build_carte_000\lxml\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('
', '
'), __file__, 'exec'))" install --record C:UsersCARTE_~1AppDataLocalTemppip-l8vvrv9g-recordinstall-record.txt --single-version-externally-managed --compile failed with error code 1 in C:UsersCARTE_~1AppDataLocalTemppip_build_carte_000lxml
Storing debug log for failure in C:Userscarte_000pippip.log
So then I looked on this great and helpful thing called The Internet and a lot of people have the same error of needing libxml2
and libxlst
. They recommend a guy called Christoph Gohlke's page where he provides some sort of binary thingy for a bunch of packages. You can find it here (quicklink to the lxml part).
So after I gave up on trying to find libxml2 and libxslt for pip, I decided to go there, and found an absolute ton of downloads. I know I need a 64-bit one, but I have no idea which "cp
" I need.
So an answer either giving me a solution on the pip
method or the Gohlke index method would be great.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…