我想用Google Cloud Storage Client Library Functions。在
为此我必须import cloudstorage
。为了得到cloudstorage
,我下载了Google Cloud Storage client library。在
我尝试使用python -c "import cloudstorage"
导入cloudstorage
。
我得到以下错误:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/fghavamian/Documents/PhD_work/Codes/python/convnet_gcloud/cloudstorage/__init__.py", line 20, in <module>
from .api_utils import RetryParams
File "/Users/fghavamian/Documents/PhD_work/Codes/python/convnet_gcloud/cloudstorage/api_utils.py", line 173
except self.retriable_exceptions, e:
^
SyntaxError: invalid syntax
我错过什么了吗?在
正如其中一条评论所说,这是使用python3的一个问题,因为python3的语法已经改变。您使用的Google云存储库似乎没有得到很好的支持,more recommended库是{a2}。在
如果您已经安装了Google Cloud SDK,可以使用下面的命令进行安装:
下面是一些示例代码(from the docs),演示了如何读写一个bucket。在
^{pr2}$相关问题 更多 >
编程相关推荐