ImportError: no module named lxml.etree

I am trying to import a premailer into my project, but it continues to fail when importing etree. I installed 2.7 binary for lxml. The lxml module imports a fine, and it shows the correct path to the library folder if I write the lxml module, but I cannot import etree from it. There is etree.pyd in the lxml folder, but python does not seem to see \ read it.

I'm on windows7 64bit.

Does anyone know what is going wrong here?

+4
source share
5 answers

Try adding the library to the GAE.yaml file.

In libraries add

-name: lxml version: latest 
+6
source

Try using etree without importing it as (lxml.etree ()) I think it does not support the module or install it if it is a module

+1
source

Try:

from lxml import etree

or

import lxml.etree <= This worked for me instead of lxml.etree()

0
source

Are you using cygwin python or something else? I wrote a very long answer about all these problems in another post, here: ImportError: resolved when using LXML

0
source

In my case, I downloaded and installed the lxml binary from lfd.uce.edu for Python 2.7. This works great for me.

0
source

Source: https://habr.com/ru/post/1491745/


All Articles