我正在尝试配置notification for a Google Cloud Storage bucket object change,但是在尝试使gsutil使用此命令使用服务帐户时遇到问题。

gcloud auth activate-service-account service-account-email --key-file path/to/key.p12


我在命令行中得到的错误是:

ERROR: (gcloud.auth.activate-service-account) PyOpenSSL is not available. If you have already installed PyOpenSSL, you will need to enable site packages by setting the environment variable CLOUDSDK_PYTHON_SITEPACKAGES to 1. If that does not work, See https://developers.google.com/cloud/sdk/crypto for details.


我遵循了this instructions to get pyOpenSSL。如果我询问有关该软件包的信息,它会告诉我它已安装

$ pip show pyopenssl
---
Name: pyOpenSSL
Version: 0.14
Location: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Requires: cryptography, six


如果我调用env命令,我也会看到环境变量

$ env
...
CLOUDSDK_PYTHON_SITEPACKAGES=1


难道我做错了什么?

最佳答案

这表明未正确安装PyOpenSSL。由于PyOpenSSL包含加密例程,因此Cloud SDK无法轻松打包,我们依赖第三方安装。

关于python - 从GCloud激活服务帐户,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23682687/

10-09 06:20