我正在尝试遵循本教程:https://developers.google.com/drive/v3/web/quickstart/python#step_1_turn_on_the_api_name
但是,当我运行它时,出现以下错误:
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
我尝试使用我读过的Google API 1.3.2版可以解决此问题,但似乎没有任何改变。
我是Python的新手。
最佳答案
我的第一个猜测是,您的oauth2client版本与您的google-api-python-client版本不兼容。
例如,尝试将google-api-python-client == 1.5.2与oauth2client == 2.2.0一起使用