user3058197 user3058197 - 5 months ago 22
Python Question

Numpy for app engine -- "No module named numpy"

I have numpy installed, but I am seeing this error in my dev_appserver:

import numpy
ImportError: No module named numpy


But when I check if numpy works from the Terminal, it does:

$ python -c "import numpy; print numpy.get_include()"
/Library/Python/2.7/site-packages/numpy/core/include


Any ideas? Thanks.

Answer

Numpy is not a builtin python module and therefore your appengine application doesn't know about it, even though it appears to be installed on your machine locally.

Luckily, google added numpy support for appengine. You can include numpy in your appengine application by including this in your app.yaml file

libraries:
- name: numpy
  version: "1.6.1"

See https://cloud.google.com/appengine/docs/python/tools/built-in-libraries-27 for more info

As you can read there, numpy is supported, but only version 1.6.1

Comments