Google Python API tries to import the deprecated oauth2client.contrib.multistore_file

1.1k Views Asked by At

I am trying to build the discovery docs for my endpoints application, but I am getting the following error:

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

The version of oauth2client is 4.1.0. It seems the file oauth2client.contrib.multistore_file was deprecated and then removed from oauth2client (https://github.com/google/oauth2client/pull/589), so I assumed my google client libraries were out of date, but I have run gcloud components update app-engine-python and I still get the same error.

Am I doing something wrong?

1

There are 1 best solutions below

7
Rose Davidson On BEST ANSWER

I'm afraid the solution is that you have to use an older version of oauth2client. If you ensure you have the latest (1.1.2) version of google-endpoints-api-management, then you will want to install google-apitools version 0.5.11 and oauth2client version 3.0.0.