8

I'm trying to import premailer in my project, but it keeps failing at the etree import. I installed the 2.7 binary for lxml. The lxml module imports fine, and it's showing the correct path to the library folder if I log the lxml module, but I can't import etree from it. There's an etree.pyd in the lxml folder but python can't seem to see\read it.

I'm on windows7 64bit.

Does anyone know what's going wrong here?

Joren
  • 9,623
  • 19
  • 63
  • 104

6 Answers6

6

Try adding the library to the GAE .yaml file.

Under libraries add

-name: lxml    
 version: latest
josliber
  • 43,891
  • 12
  • 98
  • 133
Samer Makary
  • 1,815
  • 2
  • 22
  • 25
1

Try to using etree without import it like (lxml.etree() ) I think it function no module or install it if it a module

Mr Sam
  • 981
  • 1
  • 8
  • 12
1

Install premailer using

pip install premailer

QuickSilver
  • 3,915
  • 2
  • 13
  • 29
0

Try:

from lxml import etree

or

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

tenstar
  • 9,816
  • 9
  • 24
  • 45
0

Are you using Cygwin's python, or something else? I wrote a very long answer about all these problems in another post, here: ImportError: Permission Denied while using LXML

Community
  • 1
  • 1
not2qubit
  • 14,531
  • 8
  • 95
  • 135
0

In my case, i Downloaded and installed the lxml binary from lfd.uce.edu for Python 2.7. It works fine for me.

PSL1988
  • 57
  • 4