簡體   English   中英

安裝libxml2和相關的python綁定 - Windows

[英]Install libxml2 and associated python bindings - Windows

我正在嘗試安裝libxml2,以便我可以設置python綁定並最終使用lxml。

但是,我無法在地球上工作,我應該解壓縮文件。 我沒能成功谷歌。

我是否需要Cygwin / MinGW才能使安裝成功?

目前,我將libxml2.tar.gz和libxslt.tar.gz中的文件放在Python文件夾中各自的目錄中。 因此,包含在包含的變量中的文件位於Python26 \\ include \\ libxml2 \\ libxml ...等等。

但是,當我運行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

任何幫助都會非常有幫助,因為我一直試圖讓這個持續一周以上:(

謝謝

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

如果沒有特殊原因需要從源代碼編譯,可以使用預構建的二進制文件用於lxml

意識到這是一個老話題,但在Windows上安裝此問題時遇到了問題。

我有Python版本3.4.4。

嘗試安裝whl文件時,請確保使用的是適用於您的python版本的正確版本。

所以在這種情況下我需要使用

lxml‑3.4.4‑cp34‑none‑win_amd64.whl

而不是最新的

LXML-3.4.4-CP35-NONE-win_amd64.whl

cp34表示它為其構建的python版本。

為新玩家陷阱......!

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

程序“xslt-config”似乎不在PATH環境的目錄中。 這是一篇關於在Windows上設置PATH的文章:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM