ImportError: cannot import name stubs for Google A

2019-05-20 21:30发布

Running into this error when trying quick start "hello" on gae-init

ERROR    2017-10-04 21:16:02,378 wsgi.py:263] 
    Traceback (most recent call last):
      File "/Users/anon/Desktop/Hacking/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
        handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
      File "/Users/anon/Desktop/Hacking/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 351, in __getattr__
        self._update_configs()
      File "/Users/anon/Desktop/Hacking/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 287, in _update_configs
        self._registry.initialize()
      File "/Users/anon/Desktop/Hacking/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 160, in initialize
        import_func(self._modname)
      File "/Users/anon/Desktop/Hacking/hello/main/appengine_config.py", line 17, in <module>
        from google.appengine.tools.devappserver2.python import stubs
    ImportError: cannot import name stubs

I have followed all the directions for setting up requirements on gae-init...help! Same error for the tutorial on phone book.

1条回答
Rolldiameter
2楼-- · 2019-05-20 22:01

This is a known issue in gae-init; the location of the stubs package has changed in recent versions of the SDK, causing the ImportError.

According to the this comment on the bug report you can work around the problem by changing the import statement in appengine_config.py from

from google.appengine.tools.devappserver2.python import stubs

to

from google.appengine.tools.devappserver2.python.runtime import stubs

查看更多
登录 后发表回答