Google Python API尝试导入已弃用的oauth2client.contrib.multistore_file

问题描述 投票:1回答:1

我正在尝试为我的端点应用程序构建发现文档,但是我收到以下错误:

pc@pc:~/backend$ endpointscfg.py get_discovery_doc [PROJECT_NAME]
Traceback (most recent call last):
  File "/home/pc/Downloads/google-cloud-sdk/bin/endpointscfg.py", line 10, in <module>
    import bootstrapping.bootstrapping as bootstrapping
  File "/home/pc/Downloads/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 22, in <module>
    from googlecloudsdk.core.credentials import store as c_store
  File "/home/pc/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/credentials/store.py", line 30, in <module>
    from googlecloudsdk.core.credentials import creds
  File "/home/pc/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/credentials/creds.py", line 32, in <module>
    from oauth2client.contrib import multistore_file
ImportError: cannot import name multistore_file

oauth2client的版本是4.1.0。似乎文件oauth2client.contrib.multistore_file已被弃用,然后从oauth2client(https://github.com/google/oauth2client/pull/589)删除,所以我假设我的谷歌客户端库已过时,但我运行gcloud components update app-engine-python,我仍然得到相同的错误。

难道我做错了什么?

python google-app-engine google-cloud-endpoints oauth2client google-python-api
1个回答
3
投票

我担心解决方案是您必须使用旧版本的oauth2client。如果您确保拥有最新的(1.1.2)版本的google-endpoints-api-management,那么您需要安装google-apitools版本0.5.11和oauth2client版本3.0.0

© www.soinside.com 2019 - 2024. All rights reserved.