6

Python 2.7.6, Google APIs Client Library for Python for Google App Engine, Google Developer's Guide

I'm going through the Google documentation, and trying to duplicate their example. When I run the command:

from google.appengine.ext import webapp

from Python Shell, I get the error msg:

No module named google.appengine.ext

So obviously, that file is not on my computer. I've done searches for the file on my hard drive and haven't found anything. I've run easy_install to install the Google API as instructed in the official Google Quick Start video. I'm not sure if Google's documentation is now outdated, or what is happening. Where do I get the google.appengine.ext? I'm assuming that my problem is simply that I don't have that module.

1

4 Answers 4

4

You may need to add the following line, incase you are running stand alone tests

 sys.path.append('/usr/local/google_appengine/')
 sys.path.append('/usr/local/google_appengine/lib/yaml/lib/')
 if 'google' in sys.modules:
     del sys.modules['google']
Sign up to request clarification or add additional context in comments.

3 Comments

This solution don't work for my. I'm trying from google.appengine.ext import ndb without dev_server and I don't find why. Any idea?
Just edited my answer (added sys.modules['google']). Try this
I Just try this, and doesn't work for me. Maybe I have other problems, I only want try the Google Datastore without the devserver runnig.
3

I've seen @varun answer in other question, and he use insert instead of append, and then this work perfectly, at least for me.

sys.path.insert(1, '<yourFolder>/google_appengine')
sys.path.insert(1, '<yourFolder>/google_appengine/lib/yaml/lib')
if 'google' in sys.modules:           
    del sys.modules['google']

Comments

2

App Engine samples presume that you have the App Engine SDK installed:

https://developers.google.com/appengine/downloads

https://developers.google.com/api-client-library/python/start/installation#appengine

4 Comments

Thank you. I'd actually downloaded and installed both of those, plus google-api-python-client-gae-N.M.zip And I've found the files that I think are needed. I'm guessing that the problem is the PATH defined on my operating system isn't pointing to those folders, so when I'm running a line of Python code in Python Shell from the folder C:\Python27 the IMPORT command is not finding that appengine module. It looks like I have the appengine SDK files in the PROGRAM FILES\GOOGLE\GOOGLE_APPENGINE\LIB\GOOGLE-API-PHTHON-CLIENT\OATH2CLIENT folder. I'm guessing that got set up with Launcher.
For App Engine you need to run your code within the development web server: developers.google.com/appengine/docs/python/tools/devserver. Once that's running you can use the interactive console provided: developers.google.com/appengine/docs/python/tools/…
I have used App Engine Launcher, which has a BROWSE button that opens my app in my web brower at http://localhost:8080/. I'm assuming that is the same as running the command line: dev_appserver.py myapp
@JoeGregorio PLEASE make this the answer!! I spent 4 hours looking for this.... the sample code makes it look like the SDK auto installs a bunch of modules you can just test and use normally!!
-2

The google.appengine.ext means google/appengine/ext it is just like the packages directory in Eclipse

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.