lxml - cannot import etree

4,476 views
Skip to first unread message

lyn2py

unread,
Sep 24, 2014, 10:57:25 AM9/24/14
to web...@googlegroups.com
Hello there, I am adding lxml to the modules folder. And ran into error (below).

  1. I am using the latest version of web2py from git
  2. I used to use lxml this way and it worked (that was 2 years ago)
  3. This app was created brand new with the only line added "from lxml import etree, objectify"
  4. lxml was downloaded using command "git clone git://github.com/lxml/lxml.git lxml", according to http://lxml.de/index.html#download
Thank you I appreciate any assistance!

<type 'exceptions.ImportError'> cannot import name etree


Version

web2py™Version 2.9.11-stable+timestamp.2014.09.15.18.31.17
PythonPython 2.7.5: /usr/bin/python (prefix: /System/Library/Frameworks/Python.framework/Versions/2.7)


Traceback


1.
2.
3.
4.
5.
6.
7.
Traceback (most recent call last):
 
File "/Users/./gluon/restricted.py", line 224, in restricted
   
exec ccode in environment
  File
"/Users/./applications/app/controllers/default.py", line 3, in <module>
   
from lxml import etree, objectify
ImportError
: cannot import name etree

 

Leonel Câmara

unread,
Sep 24, 2014, 11:07:57 AM9/24/14
to web...@googlegroups.com
Did you compile lxml? I'm also not sure non pure Python modules work in the app modules folder.

lyn2py

unread,
Sep 24, 2014, 11:09:42 AM9/24/14
to web...@googlegroups.com
Yes you are right Leonel, I just found this:

it needs to be compiled first. 

Thank you!

Niphlod

unread,
Sep 24, 2014, 3:09:44 PM9/24/14
to web...@googlegroups.com
sources aren't enough.... lxml needs to be built, it's not a pure python module.
Reply all
Reply to author
Forward
0 new messages