I wrote a script several times ago that contain
from lxml import etree
But unfortunately, it no longer works. In doubt, I checked the installation with:
sudo apt-get install python-lxml sudo pip install lxml sudo apt-get install libxml2-dev sudo apt-get install libxslt1-dev
I checked if this could be my python version with:
me@pc :~$ python Python 2.7.3 (default, Sep 14 2012, 14:11:57) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import lxml Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named lxml
My os is ubuntu 12.04.1 LTS with Python 2.7.3.
Everything seems beautiful. I do not see what could be the problem.
SOLVE:
Finally, importing etree with
from xml import etree
I donβt know why and if there is a difference, but it works as expected.
user1254498
source share