简体   繁体   English

从GCloud激活服务帐户

[英]Activate Service Account from GCloud

I'm trying to configure a notification for a Google Cloud Storage bucket object change however I'm stuck when trying to make gsutil use a service account with this command. 我正在尝试配置Google Cloud Storage存储桶对象更改通知,但是在尝试使gsutil使用此命令使用服务帐户时遇到问题。

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

The error I get in the command line is: 我在命令行中得到的错误是:

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.

I followed this instructions to get pyOpenSSL . 我按照以下说明获取pyOpenSSL If I ask pip about that package it tells me it is installed 如果我询问有关该软件包的信息,它会告诉我它已安装

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

I also see the environment variable if I call the env command 如果我调用env命令,我也会看到环境变量

$ env
...
CLOUDSDK_PYTHON_SITEPACKAGES=1

Am I doing something wrong? 难道我做错了什么?

This indicates that PyOpenSSL was not properly installed. 这表明未正确安装PyOpenSSL。 Since PyOpenSSL includes crypto routines, the Cloud SDK can not easily package it and we rely on third-party installation. 由于PyOpenSSL包含加密例程,因此Cloud SDK无法轻松打包,我们依赖第三方安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM