webapp2 Import Error

725 views
Skip to first unread message

Scott Lewis

unread,
Nov 13, 2010, 2:54:16 PM11/13/10
to Google App Engine
Hi,

I'm new to web development, and particularly python development, so
please forgive any obvious mistakes that I've made. Any help would be
greatly appreciated.

I'm trying to use webapp-improved (http://code.google.com/p/webapp-
improved/) on my local Windows Vista system. The results I'm getting
are:

Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine
\tools\dev_appserver.py", line 3211, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine
\tools\dev_appserver.py", line 3154, in _Dispatch
base_env_dict=env_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine
\tools\dev_appserver.py", line 527, in Dispatch
base_env_dict=base_env_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine
\tools\dev_appserver.py", line 2404, in Dispatch
self._module_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine
\tools\dev_appserver.py", line 2314, in ExecuteCGI
reset_modules = exec_script(handler_path, cgi_path, hook)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine
\tools\dev_appserver.py", line 2210, in ExecuteOrImportScript
exec module_code in script_module.__dict__
File "C:\Users\slewis\Desktop\helloworld\helloworld.py", line 1, in
<module>
import webapp2 as webapp
ImportError: No module named webapp2

My python file looks like:

import webapp2 as webapp

class HelloWorldHandler(webapp.RequestHandler):
def get(self):
self.response.out.write('Hello, World!')

app = webapp.WSGIApplication([
(r'/', HelloWorldHandler),
], debug=True)

def main():
app.run()

if __name__ == '__main__':
main()

I started development using python 2.7 and got this issue, then from
reading on this group that 2.5 was preferable, I switched to that, but
nothing has changed. I was able to run the google app engine tutorial
without errors, so I believe something is wrong with how I installed
webapp2. (I uncompressed it in a separate directory, then navigated
there in the command line and executed 'python setup.py install' and
there were no errors on the install.)

Again, any help would be greatly appreciated! Thank you.

-Scott-

Wim den Ouden

unread,
Nov 15, 2010, 1:14:00 PM11/15/10
to google-a...@googlegroups.com
Hi Scot,
Did you python setup install from the map where you unpacked webapp2?
ImportError: No module named webapp2, seems python can't find webapp2
gr
wim

> --
> You received this message because you are subscribed to the Google Groups "Google App Engine" group.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
>
>

--
gr
wdo

Demo free E-business: https://e-comm.appspot.com
Wim den Ouden Google App Engine (cloud)

Simon M

unread,
Oct 31, 2011, 7:16:56 AM10/31/11
to google-a...@googlegroups.com
Or you add webapp2 into the EXTRA_PATHS variable in the dev_appserver.py file.
Reply all
Reply to author
Forward
0 new messages