[英]google Drive api v3 file upload errors
The google drive api on python is showing the following error. python 上的 google drive api 显示以下错误。 My file upload code is already mentioned on Google Drive api v3 file upload errors via python
我的文件上传代码已在Google Drive api v3 文件上传错误中通过 python提及
I am getting the following errors,我收到以下错误,
File "/opt/cppython/lib/python3.8/site-packages/httplib2/__init__.py", line 1685, in _request
raise RedirectMissingLocation(
httplib2.RedirectMissingLocation: Redirected but the response is missing a Location: header.
My pips are as follows,我的点数如下,
google-api-core 1.22.4
google-api-python-client 1.12.3
google-auth 1.22.1
google-auth-httplib2 0.0.4
google-auth-oauthlib 0.4.1
googleapis-common-protos 1.52.0
httplib2 0.18.1
I am using python 3.8.6 .我正在使用 python 3.8.6 。 Some old posts say it need to downgrade some packages.
一些老帖子说需要降级一些包。 But I hope this will be some other issues.
但我希望这会是其他一些问题。
This issue has been solved by modifying the following connection code too google drive api.此问题已通过修改以下连接代码 google drive api 解决。
SCOPES = ['https://www.googleapis.com/auth/drive','https://www.googleapis.com/auth/drive.file','https://www.googleapis.com/auth/drive.appdata']
credentials = ServiceAccountCredentials.from_json_keyfile_name('json-file', SCOPES)
http=Http()
http.redirect_codes = http.redirect_codes - {308}
http_auth = credentials.authorize(http)
drive_service = build('drive', 'v3', http=http_auth,cache_discovery=False)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.