如何在谷歌云存储中获取GS_SECRET_ACCESS_KEY和GS_ACCESS_KEY_ID

Cit*_*895 3 gdal python-3.x google-cloud-storage

我尝试使用陆地卫星图像从公共谷歌云存储( https://console.cloud.google.com/storage/browser/gcp-public-data-landsat )读取数据。

我使用 Python3 和 GDAL。但我有一个错误

ERROR 15: GS_SECRET_ACCESS_KEY+GS_ACCESS_KEY_ID, GS_OAUTH2_REFRESH_TOKEN or GOOGLE_APPLICATION_CREDENTIALS or GS_OAUTH2_PRIVATE_KEY+GS_OAUTH2_CLIENT_EMAIL configuration options and /home/qwerty/.boto not defined
Run Code Online (Sandbox Code Playgroud)

如何获取 GS_SECRET_ACCESS_KEY 和 GS_ACCESS_KEY_ID ?

mar*_*doi 9

gs_access_key_id并且gs_secret_access_key可以通过以下方式生成

1.导航到您的 Google Cloud Storage 控制台并单击Settings

2.在Settings页面上,导航至Interoperability选项卡。

3.在此页面上,您现在可以选择一个服务帐户,然后单击Create a new key生成访问密钥和匹配的密钥。

输出:

New service account HMAC key
service-account@project.iam.gserviceaccount.com
Access key  
xxxxxxxxxxxxxxxxxxx
Secret  
xxxxxxxxxxxxxxxxxxx
Copy this key's secret if you'll need it in the future. Once you close this dialog, the secret can't be recovered.
Run Code Online (Sandbox Code Playgroud)