Q: KeyError: 'PATH_INFO' when using Pydev and Google App Engine I've just started with GAE with Eclipse under Ubuntu 12.10 and when I try to run a sample app, I've stuck with an error that I can't solve:
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

class MainPage(webapp.RequestHandler):

    def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.out.write('Hello, webapp World!')

application = webapp.WSGIApplication([('/', MainPage)], debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()

I got this error:
    Traceback (most recent call last):
  File "/home/mordrec/workspace/helloworld/helloworld.py", line 20, in <module>
    main()
  File "/home/mordrec/workspace/helloworld/helloworld.py", line 17, in main
    run_wsgi_app(application)
  File "/opt/google_appengine/google/appengine/ext/webapp/util.py", line 98, in run_wsgi_app
    run_bare_wsgi_app(add_wsgi_middleware(application))
  File "/opt/google_appengine/google/appengine/ext/webapp/util.py", line 116, in run_bare_wsgi_app
    result = application(env, _start_response)
  File "/opt/google_appengine/google/appengine/ext/webapp/_webapp25.py", line 688, in __call__
    match = regexp.match(request.path)
  File "/opt/google_appengine/lib/webob_1_1_1/webob/request.py", line 303, in path
    urllib.quote(self.path_info, PATH_SAFE))
  File "/opt/google_appengine/lib/webob_1_1_1/webob/descriptors.py", line 23, in fget
    return req.environ[key]
KeyError: 'PATH_INFO'


A: I was facing the exact same issue (but on mac) an hour or two ago. Step #5 ("Deploy It Locally") on the below instructions worked for me.
You can follow these same instructions, more or less, to get debugging to work (just do "Debug As").
http://www.mkyong.com/google-app-engine/google-app-engine-python-hello-world-example-using-eclipse/
To run it locally, right click on the helloworld.py, choose "Run As" –> "Run Configuration", create a new "PyDev Google App Run".


*

*In Main tab -> Main module, manually type the directory path of "dev_appserver.py". "Browse" button is not able to help you, type manually.


*In Arguments tab -> Program arguments, put "${project_loc}/src".


*Run it. By default, it will deploy to localhost:8080.


*Done.

