【发布时间】:2018-02-01 10:12:38
【问题描述】:
我想使用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
我错过了什么吗?
【问题讨论】:
-
我的猜测:您正在运行 Python 3,但看起来像 Python 2 语法(不再使用
except Exception, e) -
@Chris_Rands;是的,这是因为使用了 Python3。当我使用 python 2 时,错误消失了。还有一个问题,现在我收到以下错误
ImportError: No module named appengine.api。 -
您找到解决方案了吗?
-
我在github 上打开了一个问题,但看起来google-cloud-python 是云存储的最新API。
标签: python google-cloud-storage cloud-storage