0

We just upgraded Google App Engine Launcher on a Mac and a script that was working fine now is throwing a "ImportError: No module named webapp2" error when launching it via PyCharm.

Here is the trace:

Traceback (most recent call last): File "/usr/local/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) File "/usr/local/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler handler, path, err = LoadObject(self._handler) File "/usr/local/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject obj = import(path[0]) File "/Users/Michael/Documents/GitHub/velocitybyathla/main.py", line 17, in import webapp2 ImportError: No module named webapp2 INFO 2016-06-02 05:39:58,835 module.py:788] default: "GET / HTTP/1.1" 500 -

We tried adding the path to Python in Google App Engine Launcher as suggested here - but the error remains.

webapp2 is clearly installed. It worked before the upgrade and if we do "pip install webapp2" it says it is present.

We also tried "Make Symlinks" without success.

How has Google App Engine Launcher lost its path to the module? How do we fix it?

Community
  • 1
  • 1
Praxiteles
  • 5,802
  • 9
  • 47
  • 78

3 Answers3

0

Here was our solution.

(1) We reinstalled Python 2.7 (may not be necessary)

(2) We reinstalled the Google App Engine SDK (may not be necessary)

(3) We upgraded pip to the latest version (may not be necessary)

pip install --upgrade pip

(4) We uninstalled protobuf per this answer. (necessary)

pip uninstall protobuf

After this our app started running. But then we got a missing "module _ssl" error. We fixed that by adding this:

(5) We modified the app.yaml file: - name: ssl version: latest

Now our app is working properly again.

Community
  • 1
  • 1
Praxiteles
  • 5,802
  • 9
  • 47
  • 78
0

HI I have resolved this issue by making a lib folder in my project and installing all dependencies there including webapp2,webobb and others that my application use.

You could do that by typing pip install <dependecy> -t lib

If you have appengine_config.py , then you are already adding lib to your path, you can verify it by looking at

from google.appengine.ext import vendor
# Add any libraries installed in the "lib" folder.
vendor.add('lib')

you could always do this otherwise

import sys
sys.path.insert(0, 'libs')
varun
  • 4,522
  • 33
  • 28
0

I get the similar error in 1.9.37 and 1.9.38 in Windows7. When I re-install the 1.9.36 version, everything works fine.

I think this is the issue from Google App Engine team. You can check out this issue : Issue 12963: ImportError on SDK provided libraries since 1.9.37

So my quick solution is simply to re-install the old version (1.9.36 or previous).

yusong
  • 479
  • 2
  • 6
  • 21