我对 gcloud 和 python3 有点困惑
在 python3 环境中安装 gcloud 并尝试示例 Quickstart for Python in the App Engine Flexible Environment 后.
它说“您需要 Google Cloud SDK”,所以我安装了 SDK。 SDK之后的所有流程(包括SDK),都需要python2 env。
这里有个问题,用python3(官方)运行gcloud是不可能的吗? (SDK 和带有 gcloud 库的 python2 是最好的方法吗?)
最佳答案
我通过指定 Python 2 的路径(我在我的系统上命名为 python2
)解决了这个问题。
$ export CLOUDSDK_PYTHON=$(which python2)
$ ./install.sh
我建议将导出添加到您的 .bashrc
或 .zshrc
文件中。
关于python - 有没有办法将 gcloud 与 python3 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38113281/