Google Drive OAuth2

隐身守侯 提交于 2019-12-23 04:54:38

问题


I'm trying to sync between python and google drive with the following details:

Authorized JavaScript origins: http://localhost:8080

Authorized redirect URIs: http://localhost:8080/

I copied the json file to the directory and ran this code:

from pydrive.auth import GoogleAuth
gauth = GoogleAuth()
gauth.LocalWebserverAuth()

and I got this error:

from oauth2client.locked_file import LockedFile
ImportError: No module named locked_file

Can you please help me?


回答1:


Had the same issue. It looks there was a change in the newest version of the oauth2client, v2.0.0, which broke compatibility with the google-api-python-client module, which now got fixed https://github.com/adrian-the-git/google-api-python-client/commit/2122d3c9b1aece94b64f6b85c6707a42cca8b093, so an upgrade of the google-api-python-client restores compatibility and make everything working again:

$ pip install --upgrade git+https://github.com/google/google-api-python-client


来源:https://stackoverflow.com/questions/35490059/google-drive-oauth2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!