无法导入google.oauth2.id_token

时间:2019-08-26 02:58:23

标签: python google-api google-app-engine-python

所以我正在尝试验证用户ID令牌。但是我得到这个奇怪的错误。它说没有名为six.moves的模块。你们中有些人会说好吧,pip install six猜怎么着?当我尝试安装它时,点子说要求已经满足。 这就是我想要达到的https://developers.google.com/identity/sign-in/web/backend-auth

这里是发生错误的地方from google.oauth2 import id_token

ERROR    2019-08-26 02:50:39,688 wsgi.py:269] 
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 311, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 85, in LoadObject
    obj = __import__(path[0])
  File "C:\Users\Touseef\Desktop\Projects\base-project\base-project\Routes.py", line 3, in <module>
    from controllers import Home,social_sign_up
  File "C:\Users\Touseef\Desktop\Projects\base-project\base-project\controllers\social_sign_up.py", line 3, in <module>
    from google.oauth2 import id_token
  File "C:\Python27\lib\site-packages\google\oauth2\id_token.py", line 63, in <module>
    from six.moves import http_client
ImportError: No module named six.moves
INFO     2019-08-26 07:50:39,698 module.py:861] default: "GET / HTTP/1.1" 500 -

知道如何解决该错误吗?

1 个答案:

答案 0 :(得分:0)

检查此答案:

ImportError: No module named six

如果您无法访问该链接,它实际上表示您应该像这样卸载六个:

pip uninstall six

,然后重新安装。似乎您正在使用Python2.7,所以

pip install six

工作正常。