python - 得到一个意外的关键字参数 'timeout'(Python 中的 google-cloud-storage)

标签 python google-app-engine google-cloud-storage

使用 google-cloud-storage 的 Python 项目在本地运行良好,但从 App Engine 运行时显示错误:

Traceback (most recent call last): 
File "/opt/python3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() 
File "/opt/python3.7/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs)  [...] 
File "/env/lib/python3.7/site-packages/google/cloud/storage/blob.py", line 2107, in upload_from_string timeout=timeout,  
File "/env/lib/python3.7/site-packages/google/cloud/storage/blob.py", line 1921, in upload_from_file timeout=timeout,  
File "/env/lib/python3.7/site-packages/google/cloud/storage/blob.py", line 1769, in _do_upload timeout=timeout,  
File "/env/lib/python3.7/site-packages/google/cloud/storage/blob.py", line 1405, in _do_multipart_upload transport, data, object_metadata, content_type, timeout=timeout 
TypeError: transmit() got an unexpected keyword argument 'timeout'

最佳答案

安装 google-resumable-media==0.6 解决了这个问题。之前安装的版本是0.7。

pip uninstall google-resumable-media
pip uninstall google-cloud-storage
pip install google-resumable-media==0.6.0
pip install google-cloud-storage==1.30.0

关于python - 得到一个意外的关键字参数 'timeout'(Python 中的 google-cloud-storage),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63082277/

相关文章:

python - 打包库的正确方法,以便它在不带前导包名称的情况下正确导入

c++ - 使用SWIG将自定义C++异常动态地重新抛出为Python异常

python - 通过 Web3.py 在 Infura 节点获取以太坊 txpool 待处理交易的不同方式

json - Golang - 从 JSON 响应中隐藏空结构

python - "gsutil rm"命令使用 STDIN

google-bigquery - 谷歌云数据流 : How to read data from a Database and write to BigQuery

python - 在 Intellij/Pycharm 中运行 Django 时出错

javascript - Javascript函数什么时候执行? php 变量没有改变传入的参数

google-app-engine - GAE 数据存储 : Normalization?

java - 使用 java -maven 代码获取 Firebase 图像 url 时出现问题 [不是 android]