ImportError: cannot import name 'etree' on Python 3.6 ImportError: cannot import name 'etree' on Python 3.6 python-3.x python-3.x

ImportError: cannot import name 'etree' on Python 3.6


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.


Got this working in Lambda with python 3.6

Turns out lxml wraps c libraries that are compiled for a certain processor architecture (I think)

Use precompiled binaries for lambda here: https://github.com/JFox/aws-lambda-lxml


For Windows:

After having the same problem at the instance of my Windows 2019 server, Python 3.8 and Anaconda, I downloaded the corresponding whl package, installed it with

pip install lxml-4.6.3-cp38-cp38-win_amd64

It now works without problem.