title: "ImportError: No module named webapp2" after Linux SDK upgrade (1.9.35 -> 1.9.38)
body: <p>After upgrading my GAE Python Linux SDK from version 1.9.35 to 1.9.38 my application stopped working, all requests are failing in similar manner:</p>
  
  <pre><code>ERROR    2016-06-10 17:55:06,100 wsgi.py:263] 
  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 "/home/dancorn/src/apartsw/main/main.py", line 9, in &lt;module&gt;
      import webapp2
  ImportError: No module named webapp2
  INFO     2016-06-10 17:55:06,102 module.py:788] default: "GET / HTTP/1.1" 500 -
  </code></pre>
  
  <p>I first thought that I somehow screwed up my PyCharm config, but simply rolling back to 1.9.35 (by pointing my <code>/usr/local/google_appengine</code> symlink back to the respective SDK version dir) got things back working as expected.</p>
  
  <p>The <a href="https://cloud.google.com/appengine/docs/python/release-notes" rel="nofollow noreferrer">SDK release notes</a> don't appear to indicate anything related.</p>
  
  <p>I found <a href="http://kawahara.ca/gae-python-importerror-no-module-named-webapp2/" rel="nofollow noreferrer">a similar report</a>, but the suggested fix (rolling back) is not really acceptable down the road.</p>
  
  <p>I also found this post, but I don't have protobuf (explicitly) installed: <a href="https://stackoverflow.com/questions/37583769/how-to-solve-a-webapp2-import-error-after-upgrading-google-app-engine-launcher">How to solve a webapp2 import error after upgrading Google App Engine launcher?</a>. Still chewing on the related posts which led me to this potentially related delta in the SDK, which I'll investigate next:</p>
  
  <pre><code>diff google_appengine_1.9.35/_python_runtime.py google_appengine_1.9.38/_python_runtime.py
  71a72,75
  &gt;   if 'google' in sys.modules:
  &gt;     google_path = os.path.join(os.path.dirname(__file__), 'google')
  &gt;     google_module = sys.modules['google']
  &gt;     google_module.__path__.append(google_path)
  74,77c78
  &lt; 
  &lt; 
  &lt;   if 'google' in sys.modules:
  &lt;     del sys.modules['google']
  ---
  &gt;     google_module.__file__ = google_path
  </code></pre>
  
  <p>Any other investigation leads?</p>