简体   繁体   English

找不到 lxml 模块

[英]lxml module cannot be found

Download lxml-2.3.3.tar.gz下载 lxml-2.3.3.tar.gz

Extract it then run sudo python setup.py build under the folder解压后在文件夹下运行sudo python setup.py build

python selftest.py =>184 tests ok. python selftest.py =>184 测试正常。

Extract lxml folder lxml-2.3.3\src\lxml to my python path解压lxml文件夹lxml-2.3.3\src\lxml到我的python路径

Running the application will cause error - Usage of the XML aspects requires lxml运行应用会报错——XML方面的使用需要lxml

Is that correct way to build and install?这是构建和安装的正确方法吗?

After building, you have to install using构建后,您必须使用安装

python setup.py install

Simply copying the folder to python path will not work.简单地将文件夹复制到 python 路径是行不通的。

Or you can just use pip and run或者您可以只使用pip并运行

pip install lxml

For Windows, you can download the pre-built module from this windows python lib site .对于 Windows,您可以从这个windows python 库站点下载预构建模块。 Note that this is unofficial, but highly respected.请注意,这是非官方的,但受到高度尊重。

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

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