user2313131
user2313131

Reputation: 11

Google app engine and numpy don't work toghether on local development server

I am trying to work with numpy and google app engine locally on the development server on mac osx 10.9.

However I dont cannot run them togehter. So I have two questions: - Why can I not install numpy 1.6.1? - Why can I import numpy 1.8.1 in normal python but not in combination with GAE?

Below are the 2 scenarios that fail:

Running app locally: 1] Trying to use numpy 1.8.0

app.yaml:
libraries:
- name: numpy
  version: latest

Numpy version:
$ pip freeze
numpy==1.8.0

in main.py:
import numpy as np
    Error Message:
    ImportError: No module named future_builtins

however: 
$ python
>>> import numpy as np
>>>
Importing it without google app engine works. 

2] Trying to install numpy 1.6.1 on my mac $ pip install numpy==1.6.1

clang: error: invalid argument '-faltivec' only allowed with 'ppc/ppc64'
....
failed with exit status 1   

Settings: Python path for GAE launcher: /usr/local/bin/python

Python version:
Python 2.7.6

OS:
MAC OS X 10.9

$ brew --version
0.9.5

$ pip --version
pip 1.4.1 from /usr/local/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg (python 2.7)

Upvotes: 1

Views: 1082

Answers (1)

Greg
Greg

Reputation: 10360

The error with 1.8 is due to this bug, marked as fixed but not yet in a released SDK: https://code.google.com/p/googleappengine/issues/detail?id=8367

In the meantime, you can add 'future_builtins' to the end of the list in google/appengine/tools/devappserver2/python/sandbox.py, line 814. Note that the comment along with 'Fixed' suggests this won't be in release 1.8.9, so you'll have to re-apply the fix when you upgrade to that version.

(Fwiw, I get the same error trying to install 1.6.1)

Upvotes: 2

Related Questions