numpy is supported as a library in google app engine according to the official documentation here. I was not able to import it after a few trials, can anyone share the code to use it?
I believe it should be called in app.yaml with:
libraries:
- name: numpy
version: "1.6.1"
And then be imported in the script somehow. I tried the obvious:
import numpy
but it gave me the following error:
ImportError: No module named numpy
Any simple code is appreciated, for example how do you do the "numpy.average" function in a google app engine script?
>>> data = range(1,5)
>>> data
[1, 2, 3, 4]
>>> np.average(data)
2.5
If you want it to work locally you have to download and install it locally (I got mine from here http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy)
Besides that you have to make sure you are running python27, and that you're importing it in the app.yaml file, e.g.:
You can check out the code for the Predator app demoed in the Getting the Most Out of Python 2.7 on App Engine by Brian Quinlan. He walks you through it starting at 11:00