Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Drive API - ImportError: cannot import name util

I'm trying to follow this tutorial: https://developers.google.com/drive/v3/web/quickstart/python#step_1_turn_on_the_api_name

However when I run it 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've tried using version 1.3.2 of the Google API which I read may fix the issue but it didn't seem to change anything.

I'm fairly new to Python.

like image 956
Jimmy Avatar asked Nov 20 '16 19:11

Jimmy


Video Answer


1 Answers

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

Try to use google-api-python-client==1.5.2 together with oauth2client==2.2.0, for example

like image 165
iver56 Avatar answered Sep 28 '22 11:09

iver56