简体   繁体   English

google Drive api v3 文件上传错误

[英]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.

相关问题 googleapiclient.errors.HttpError 与 google drive v3 api 上传错误 - googleapiclient.errors.HttpError with google drive v3 api upload error 使用驱动器 API V3 上传更新的带有 Python 的 Google 驱动器上的文件不起作用 - Upload updated a file on Google Drive with Python using Drive API V3 does not work 我如何使用谷歌驱动器 api v3 将文件上传到共享驱动器 - How can i used google drive api v3 to upload a file to shared drive 谷歌驱动器API v3(python)更新文件权限“角色” - google drive api v3 (python) update file premissions “role” 谷歌驱动器 API v3 使用 Python - Google Drive API v3 using Python 使用 Python 中的 next_chunk() 上传 Google Drive API v3 错误查看状态的说明? - Explaination on error viewing status of Google Drive API v3 upload using next_chunk() in Python? 使用gzip通过API v3 Python 3优化上传到云端硬盘 - Using gzip to Optimize Upload to Drive using API v3 Python 3 Google Drive API v3 更改文件权限并获取可公开共享的链接 (Python) - Google Drive API v3 Change File Permissions and Get Publicly Shareable Link (Python) 在Python 3上使用Drive API v3恢复上传并显示上传百分比 - Resumable Upload and Show Percentage of Upload using Drive API v3 on Python 3 无法使用 API &#39;https://www.googleapis.com/drive/v3/files/<file_id> /export?mimeType=image%2Fjpeg&#39; 从谷歌驱动器获取图像 - Cannot use API 'https://www.googleapis.com/drive/v3/files/<file_id>/export?mimeType=image%2Fjpeg' to get image from google drive
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM