1

我试图建立我的端点的应用程序发现的文档,但我收到以下错误:谷歌的Python API尝试导入已弃用oauth2client.contrib.multistore_file

[email protected]:~/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,我仍然得到相同的错误。

我做错了什么?

回答

2

恐怕解决的办法是你必须使用旧版本的oauth2client。如果您确保自己拥有最新的(1.1.2)版本的google-endpoints-api-management,那么您需要安装google-apitools版本0.5.11和oauth2client版本3.0.0

相关问题