简体   繁体   English

安装libxml2和相关的python绑定 - Windows

[英]Install libxml2 and associated python bindings - Windows

I am attempting to install libxml2 so that I can setup the python bindings and eventually use lxml. 我正在尝试安装libxml2,以便我可以设置python绑定并最终使用lxml。

However I am unable to work out here on earth I am supposed to be unzipping the files. 但是,我无法在地球上工作,我应该解压缩文件。 I haven't been able to google successfully. 我没能成功谷歌。

Do I need Cygwin/MinGW for the installation to be successful? 我是否需要Cygwin / MinGW才能使安装成功?

At the moment I have the files from the libxml2.tar.gz and libxslt.tar.gz in their respective directories within my Python folder. 目前,我将libxml2.tar.gz和libxslt.tar.gz中的文件放在Python文件夹中各自的目录中。 So files that were in the tars under include are in Python26\\include\\libxml2\\libxml... and so on. 因此,包含在包含的变量中的文件位于Python26 \\ include \\ libxml2 \\ libxml ...等等。

however when i run a easy_install lxml i receive the following output: 但是,当我运行easy_install lxml时,我收到以下输出:

Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.2.4
Downloading http://codespeak.net/lxml/lxml-2.2.4.tgz
Processing lxml-2.2.4.tgz
Running lxml-2.2.4\setup.py -q bdist_egg --dist-dir c:\users\rocco\appdata\local
\temp\easy_install-1xwbhy\lxml-2.2.4\egg-dist-tmp-9zwhe4
Building lxml version 2.2.4.
NOTE: Trying to build without Cython, pre-generated 'src/lxml/lxml.etree.c' need
s to be available.
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 'src\lxml'
warning: no files found matching 'lxml.objectify.c' under directory 'src\lxml'
warning: no files found matching 'lxml.etree.h' under directory 'src\lxml'
warning: no files found matching 'lxml.etree_api.h' under directory 'src\lxml'
warning: no files found matching 'etree_defs.h' under directory 'src\lxml'
warning: no files found matching 'pubkey.asc' under directory 'doc'
warning: no files found matching 'tagpython*.png' under directory 'doc'
error: Setup script exited with error: Unable to find vcvarsall.bat

Any help whatsoever would be very helpful as I've been trying to get this going for over a week now :( 任何帮助都会非常有帮助,因为我一直试图让这个持续一周以上:(

Thanks 谢谢

最新版本的lxml(以及各种其他Python包)的Windows二进制文件可在http://www.lfd.uci.edu/~gohlke/pythonlibs/找到。

如果没有特殊原因需要从源代码编译,可以使用预构建的二进制文件用于lxml

Realize this is an old topic but have had issues installing this on windows. 意识到这是一个老话题,但在Windows上安装此问题时遇到了问题。

I have Python version 3.4.4. 我有Python版本3.4.4。

When attempting to install whl files make sure you are using the correct version for your version of python. 尝试安装whl文件时,请确保使用的是适用于您的python版本的正确版本。

so in this case i needed to use 所以在这种情况下我需要使用

lxml‑3.4.4‑cp34‑none‑win_amd64.whl

and not the latest which was 而不是最新的

lxml‑3.4.4‑cp35‑none‑win_amd64.whl LXML-3.4.4-CP35-NONE-win_amd64.whl

cp34 indicates the python version its built for. cp34表示它为其构建的python版本。

Trap for new players...! 为新玩家陷阱......!

如果您使用的是python 2.5.x,只需使用“ easy_install lxml == 2.2.2 ”进行安装即可

It appears that the program "xslt-config" is not located in a directory in your PATH environment. 程序“xslt-config”似乎不在PATH环境的目录中。 Here's an article on setting PATH on Windows: 这是一篇关于在Windows上设置PATH的文章:

http://www.cs.usask.ca/~wew036/latex/env.html http://www.cs.usask.ca/~wew036/latex/env.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM