有什么办法可以将gcloud与python3一起使用吗? [英] Is there any way to use gcloud with python3?

查看:107
本文介绍了有什么办法可以将gcloud与python3一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对python3的gcloud感到有些困惑

I have a little confused about gcloud with python3

在python3 env中安装gcloud并尝试以 Python快速入门为例App Engine灵活环境.

After I installed gcloud in python3 env and I tried to example Quickstart for Python in the App Engine Flexible Environment.

说您需要Google Cloud SDK",所以我安装了SDK. SDK(包括SDK)之后的所有过程,都需要python2 env.

It said 'You need Google Cloud SDK', so I installed SDK. All the process after SDK(including SDK), It needs python2 env.

这里是一个问题,用python3(正式地)运行gcloud是不可能的吗? (带有gcloud库的SDK和python2是最好的方法吗?)

Here is a question, Is is impossible to run gcloud with python3 (officially ) yet? (SDK and python2 with gcloud library is best way?)

推荐答案

我通过指定Python 2的路径(我在系统上将其命名为python2)来解决此问题.

I worked around this issue by specifying the path to Python 2 (that I named python2 on my system).

$ export CLOUDSDK_PYTHON=$(which python2)
$ ./install.sh

我建议将导出内容添加到您的.bashrc.zshrc文件中.

I suggest adding the export to your .bashrc or .zshrc file.

这篇关于有什么办法可以将gcloud与python3一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆