Google Drive API - ImportError: cannot import name

I am trying to follow this guide: https://developers.google.com/drive/v3/web/quickstart/python#step_1_turn_on_the_api_name

However, when I start, I get the following error:

Traceback (most recent call last): File "test.py", line 5, in <module> from apiclient import discovery File "/Library/Python/2.7/site-packages/apiclient/__init__.py", line 16, in <module> from googleapiclient import channel File "/Library/Python/2.7/site-packages/googleapiclient/channel.py", line 62, in <module> from googleapiclient import errors File "/Library/Python/2.7/site-packages/googleapiclient/errors.py", line 25, in <module> from oauth2client import util ImportError: cannot import name util 

I tried using version 1.3.2 of the Google API that I read might solve the problem, but it didn’t change anything.

I am new to Python.

+4
source share
1 answer

My first guess: your version of oauth2client is incompatible with your version of google-api-python-client.

Try using google-api-python-client == 1.5.2 along with oauth2client == 2.2.0, for example

+3
source

Source: https://habr.com/ru/post/926166/


All Articles