Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
168 views
in Technique[技术] by (71.8m points)

easy_install lxml on Python 2.7 on Windows

I'm using python 2.7 on Windows. How come the following error occurs when I try to install [lxml][1] using [setuptools][2]'s easy_install?

C:>easy_install lxml
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.3.3
Downloading http://lxml.de/files/lxml-2.3.3.tgz
Processing lxml-2.3.3.tgz
Running lxml-2.3.3setup.py -q bdist_egg --dist-dir c:usersmy_userappdatalocalempeasy_install-mtrdj2lxml-2.3.3egg-dist-tmp-tq8rx4
Building lxml version 2.3.3.
Building without Cython.
ERROR: '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
warning: no files found matching 'lxml.etree.c' under directory 'srclxml'
warning: no files found matching 'lxml.objectify.c' under directory 'srclxml'
warning: no files found matching 'lxml.etree.h' under directory 'srclxml'
warning: no files found matching 'lxml.etree_api.h' under directory 'srclxml'
warning: no files found matching 'etree_defs.h' under directory 'srclxml'
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'
error: Setup script exited with error: Unable to find vcvarsall.bat

Downloading the package and running setup.py install also doesn't help:

D:My DocumentsInstallsDevPythonlxmllxml-2.3.3>setup.py install
Building lxml version 2.3.3.
Building without Cython.
ERROR: '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 bdist_egg
running egg_info
writing srclxml.egg-infoPKG-INFO
writing top-level names to srclxml.egg-infoop_level.txt
writing dependency_links to srclxml.egg-infodependency_links.txt
reading manifest file 'srclxml.egg-infoSOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'lxml.etree.c' under directory 'srclxml'
warning: no files found matching 'lxml.objectify.c' under directory 'srclxml'
warning: no files found matching 'lxml.etree.h' under directory 'srclxml'
warning: no files found matching 'lxml.etree_api.h' under directory 'srclxml'
warning: no files found matching 'etree_defs.h' under directory 'srclxml'
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'
writing manifest file 'srclxml.egg-infoSOURCES.txt'
installing library code to builddist.win32egg
running install_lib
running build_py
creating build
creating buildlib.win32-2.7
creating buildlib.win32-2.7lxml
copying srclxmluilder.py -> buildlib.win32-2.7lxml
copying srclxmlcssselect.py -> buildlib.win32-2.7lxml
copying srclxmldoctestcompare.py -> buildlib.win32-2.7lxml
copying srclxmlElementInclude.py -> buildlib.win32-2.7lxml
copying srclxmlpyclasslookup.py -> buildlib.win32-2.7lxml
copying srclxmlsax.py -> buildlib.win32-2.7lxml
copying srclxmlusedoctest.py -> buildlib.win32-2.7lxml
copying srclxml\_elementpath.py -> buildlib.win32-2.7lxml
copying srclxml\__init__.py -> buildlib.win32-2.7lxml
creating buildlib.win32-2.7lxmlhtml
copying srclxmlhtmluilder.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtmlclean.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtmldefs.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtmldiff.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtmlElementSoup.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtmlformfill.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtmlhtml5parser.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtmlsoupparser.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtmlusedoctest.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtml\_dictmixin.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtml\_diffcommand.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtml\_html5builder.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtml\_setmixin.py -> buildlib.win32-2.7lxmlhtml
copying srclxmlhtml\__init__.py -> buildlib.win32-2.7lxmlhtml
creating buildlib.win32-2.7lxmlisoschematron
copying srclxmlisoschematron\__init__.py -> buildlib.win32-2.7lxmlisoschematron
copying srclxmletreepublic.pxd -> buildlib.win32-2.7lxml
copying srclxmlree.pxd -> buildlib.win32-2.7lxml
copying srclxmletree_defs.h -> buildlib.win32-2.7lxml
creating buildlib.win32-2.7lxmlisoschematron
esources
creating buildlib.win32-2.7lxmlisoschematron
esources
ng
copying srclxmlisoschematron
esources
ngiso-schematron.rng -> buildlib.win32-2.7lxmlisoschematron
esources
ng
creating buildlib.win32-2.7lxmlisoschematron
esourcesxsl
copying srclxmlisoschematron
esourcesxslRNG2Schtrn.xsl -> buildlib.win32-2.7lxmlisoschematron
esourcesxsl
copying srclxmlisoschematron
esourcesxslXSD2Schtrn.xsl -> buildlib.win32-2.7lxmlisoschematron
esourcesxsl
creating buildlib.win32-2.7lxmlisoschematron
esourcesxsliso-schematron-xslt1
copying srclxmlisoschematron
esourcesxsliso-schematron-xslt1iso_abstract_expand.xsl -> buildlib.win32-2.7lxmlisoschematron
esourcesxsliso-schematron-xslt1
copying srclxmlisoschematron
esourcesxsliso-schematron-xslt1iso_dsdl_include.xsl -> buildlib.win32-2.7lxmlisoschematron
esourcesxsliso-schematron-xslt1
copying srclxmlisoschematron
esourcesxsliso-schematron-xslt1iso_schematron_message.xsl -> buildlib.win32-2.7lxmlisoschematron
esourcesxsliso-schematron-xslt1
copying srclxmlisoschematron
esourcesxsliso-schematron-xslt1iso_schematron_skeleton_for_xslt1.xsl -> buildlib.win32-2.7lxmlisoschematron
esourcesxsliso-schematron-xslt1
copying srclxmlisoschematron
esourcesxsliso-schematron-xslt1iso_svrl_for_xslt1.xsl -> buildlib.win32-2.7lxmlisoschematron
esourcesxsliso-schematron-xslt1
copying srclxmlisoschematron
esourcesxsliso-schematron-xslt1
eadme.txt -> buildlib.win32-2.7lxmlisoschematron
esourcesxsliso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Unable to find vcvarsall.bat

  [1]: http://lxml.de/
  [2]: http://pypi.python.org/pypi/setuptools
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

lxml >= 3.x.x

  1. download one of the MS Windows Installer packages
  2. easy_install "c:/lxml_installer.exe" (credit kobejohn)

MS Windows Installer downloads available for lxml 3.3.5

a list of all binary/egg lxml package downloads.


lxml 2.3.x

there is no windows binary egg for lxml 2.3.3 (2.3.0 is the latest from 2.x.x).
without giving a version number easy_install will download the latest sources,
but you dont have the libxml2 and libxslt installed.

you could install the missing libs or you could try the 2.3 as there are binary eggs for windows:
easy_install lxml==2.3


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...