Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 无法访问google bucket无效字符串值:';noAcl:';。允许值:[完整,noacl]_Python_Python 3.x_Google Cloud Storage - Fatal编程技术网

Python 无法访问google bucket无效字符串值:';noAcl:';。允许值:[完整,noacl]

Python 无法访问google bucket无效字符串值:';noAcl:';。允许值:[完整,noacl],python,python-3.x,google-cloud-storage,Python,Python 3.x,Google Cloud Storage,我首先创建了谷歌云虚拟映像 我有这样的代码: >>> from google.cloud import storage >>> from io import BytesIO >>> client = storage.Client() >>> bucket = client.get_bucket('landsst') 然而,我得到这样的错误: Traceback (most recent call last): Fi

我首先创建了谷歌云虚拟映像

我有这样的代码:

>>> from google.cloud import storage 
>>> from io import BytesIO
>>> client = storage.Client() 
>>> bucket = client.get_bucket('landsst')
然而,我得到这样的错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/iashrapov/anaconda3/lib/python3.6/site-packages/google/cloud/storage/client.py", line 177, in get_buc
ket
    bucket.reload(client=self)
  File "/home/iashrapov/anaconda3/lib/python3.6/site-packages/google/cloud/storage/_helpers.py", line 108, in reloa
d
    _target_object=self)
  File "/home/iashrapov/anaconda3/lib/python3.6/site-packages/google/cloud/_http.py", line 293, in api_request
    raise exceptions.from_http_response(response)
google.api_core.exceptions.Forbidden: 403 GET https://www.googleapis.com/storage/v1/b/lanst?projection=noAcl
: 606507140911-compute@developer.gserviceaccount.com does not have storage.buckets.get access to landsbyconst.
我做错了什么

PS.通过本地PC运行相同代码返回错误:

DefaultCredentialsError:无法自动确定凭据。请设置GOOGLE\u应用程序\u凭据或 显式创建凭据并重新运行应用程序。更多 信息,请参阅

所以一开始我没有权限错误,嗯


upd。我可以连接到我自己创建的bucket

肯定是执行
gcloud auth应用程序默认登录
而不是
gcloud auth login为我解决了这个403问题

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalidParameter",
    "message": "Invalid string value: 'noAcl:'. Allowed values: [full, noacl]",
    "locationType": "parameter",
    "location": "projection"
   }
  ],
  "code": 400,
  "message": "Invalid string value: 'noAcl:'. Allowed values: [full, noacl]"
 }
}