1
votes

I am a first time user of Python, I have Eclipse (Helios) on Windows XP and Pydev installed and all is well except that when I am following the GAE tutorial for Python

I get the unresolved import error on run_wsgi_app and webapp from from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app

The code runs fine. I have looked for an answer and added

F:\Program Files\Google\google_appengine\google\appengine\ext and

F:\Program Files\Google\google_appengine\google\appengine\ext\webapp

to be sure to my PYTHONPATH via the Eclipse Python Interpreter interface. I have removed and re-added the interpreter, pressed Apply, restarted Eclipse but all to no avail.

I am posting this as I am sure many new users with GAE + Python + Eclipse + Pydev would have the same problem.

Regards, Chris

3
In PyDev you should be able to create a Google App Engine project that will automatically find and add the required directories. If it isn't working correctly check this post: stackoverflow.com/questions/5019469/… - Calvin
Yes thank you Calvin, creating a Google App Engine project (as opposed to a Python project) in Eclipse and following the Python GAE tutorial as before does indeed solve the original problem. Best regards - Echancrure

3 Answers

2
votes

Add the package parent directory (the first directory with a init.py file)

F:\Program Files\Google\google_appengine

to the PYTHONPATH in Eclipse under the 'External Libraries' tab.

Also beware of a bug in PyDev that does not respect/understand Python namespaces (as opposed to packages). For more info see:

http://sourceforge.net/tracker/index.php?func=detail&aid=3284882&group_id=85796&atid=577329

0
votes

In general, add the package's parent directory to PYTHONPATH, not the module subdirectories:

F:\Program Files\Google\google_appengine
0
votes

adding ${GOOGLE_APP_ENGINE}/lib/webapp2-2.5.2 to the "External Libraries" worked for me. App Engine SDK ver:1.8.2 Python version: 2.7