You are running a Flexible Environment virtual machine here. This 
environment does not include the App Engine libraries (nor does it 
recommend it, unless you need to port an existing app). You should just use 
urllib2 or the requests library directly, since you are running on a VM. 
You have no need for the urlfetch API.

See the official documentation about this 
here: 
https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml#general

There is a hint, although it doesn't explicitly say it, that if you are 
writing a new application, you probably shouldn't use the python-compat 
runtime in this 
document: 
https://cloud.google.com/appengine/docs/flexible/python/migrating-an-existing-app

Alternatively: Use the "Standard Environment" and you won't have this 
problem.


On Wednesday, October 19, 2016 at 4:21:23 PM UTC-4, Keith Preston wrote:
>
> I've been following some of the examples, but seem to have problems 
> importing from the google.appengine.api once I've deployed to GAE.     
> Adding some debugging the error is No module named 'google'
>
>
> Do I need to do anything special in my main.py, app.yaml or 
> requirement.txt to get the google.appengine.api?   I can't seem to find 
> details about this in the documentation
>
>
> main.py
>
> try:
>
> from google.appengine.api import urlfetch
>
> except Exception as e:
>
> error = str(e)
>
>
> app.yaml
>
> runtime: python
>
> vm: true
>
> entrypoint: gunicorn -b :$PORT main:app
>
> runtime_config:
>
> python_version: 3
>
>
> requirements.txt
>
> Flask==0.11.1
>
> gunicorn==19.6.0
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/a3bc8a41-4bea-4127-a31f-08ac56004f28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to