2

I'm using virtualenv with Python 2.7 for a Django project, on Google App Engine sandbox on Windows environment. I try to use this amazon api library which requires lxml as a dependency.

After installing lxml (and all other dependencies) and trying to import amazon api module, I'm getting the following error:

ImportError: No module named lxml.objectify

objectify module exists in the correct folder. I searched online for a solution and saw that installing lxml on Windows can be pain in the ass, but couldn't find a solution.

What I already tried:

  • Uninstalling and installing lxml
  • Installing version 3.8.0 and 3.7.3
  • Installing lxml as pip or binary installer
  • Installing lxml from whl package

Did someone faced this issue and was able to solve it?

Cheers!

Crispy Holiday
  • 412
  • 1
  • 9
  • 28

1 Answers1

3

lxml is one of App Engine's built-in third party libraries.

To use it, you need to:

add it to the libraries directive of your app.yaml file:

libraries:
- name: lxml
  version: 3.7.3

and Install it locally using pip, because it's not included in the SDK:

pip install lxml==3.7.3

or install via the vendoring process.

pip install --target lib lxml==3.7.3

If lxml is not added to app.yaml you will see the dev server will report an ImportError, regardless of how lxml was installed.

snakecharmerb
  • 47,570
  • 11
  • 100
  • 153