I have a working setup of lxml.etree working on my windows desktop.

Since I wanted to move this to my server, instead of installing lxml in sitepackages, I wanted to install it inside the modules directly, so this lxml version is specific to this applicaion/site.

I copied my lxml directory directly under modules on the linux server, and I got this error :

No module named etree

So it seems it understood there is an lxml, package but couldn't see etree inside it. Any ideas ? Also, I couldn't find exactly where I can download the binaries for ubuntu 9.10 on the site : http://lxml.de/installation.html#installation

有帮助吗?

解决方案

You can't just copy the Windows version over to a Linux server; lxml uses C extensions which need to be compiled for the target platform.

The etree module is such a compiled extension, on Linux that'd be etree.so, while on Windows it would be a etree.dll file instead, for example.

For Ubuntu, look for python-lxml, or install the dependencies libxml2-dev, libxslt1-dev and python-dev, plus python-pip, then use sudo pip install lxml to install lxml on your server.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top