Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am getting error while running "from lxml import tree" on python3.6

>>> import lxml
>>> from lxml import etree
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'etree'

The same working on python3.4, I have tried many things to troubleshoot as below but didn't success.

python -m pip uninstall lxml
python -m pip install lxml==3.6.0

pip install -t /usr/local/lib/python3.6/dist-packages lxml==3.6.0
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.8k views
Welcome To Ask or Share your Answers For Others

1 Answer

Just in case anybody has similar issue. I also encountered this problem using Python3.6. Just by uninstalling lxml and installing it again with pip the issue is resolved.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...