谷歌云sdk:设置环境variable_ python - > Linux的 [英] google cloud sdk: set environment variable_ python --> linux

查看:530
本文介绍了谷歌云sdk:设置环境variable_ python - > Linux的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 错误:Google Cloud SDK不支持Python 3。请使用2.6或更高版本的Python 2.x版本。 

如果您安装了兼容的Python解释器,则可以通过将CLOUDSDK_PYTHON环境变量设置为指向它来使用它。

我想我们应该问的第一个问题是的客户为什么不能雇用某人来确保他们的云sdk能够与python 3兼容?

在linux上如何克服这个错误?需要编辑哪些特定文件?这些文件应放在哪里?



我周围搜索了很多,并找到这个问题关于如何在Windows上解决这个问题,但答案并不是那么全面。






到目前为止我尝试过:

修改名为 app.yaml 的文件的一个文档来源,但我使用命令 find查找。 -nameapp.yaml并且不存在这样的文件。

具体来说,我使用的是arch linux,我最初尝试使用 AUR软件包,但它不起作用。

所以我从 documentation ,确保编辑 ./ install.sh 文件,指定 python2 按照有关 Google群组的讨论,那也行不通。在运行命令 gcloud auth login 后,我得到与上面相同的错误。

解决方案

这是一个非常容易解决的问题。 Arch命令行上的本地 python 命令实际上适用于Python 3. SDK需要Python2.7和


  • 只需进入google-cloud-sdk文件夹并打开 install.sh 文件即可。

  • 更改CLOUDSDK_PYTHON =pythonvalue to CLOUDSDK_PYTHON =python2.7
  • 使用

     ./ install.sh 

    在同一个文件夹中并按照提示进行操作。




就这样。


ERROR: Python 3 is not supported by the Google Cloud SDK.  Please use a Python 2.x version that is 2.6 or greater.

If you have a compatible Python interpreter installed, you can use it by setting the CLOUDSDK_PYTHON environment variable to point to it.

I guess the first question we should be asking is "with all the money google makes off of their customers why can't they hire someone to ensure that their cloud sdk works with python 3?"

How exactly to overcome this error on linux? What specific files need to be edited? and where should those files be located?

I searched around, a lot, and found this question about how to fix this on Windows, but the answer is not really that comprehensive.


Thus far I've attempted:

One source of documentationsays to modify a file called app.yaml, but I searched using the command find . -name "app.yaml" and no such file exists.

Specifically I'm using arch linux, I originally tried to use the AUR package but it's disfunctional.

So I installed from the documentation, making sure to edit the ./install.sh file, specifying python2 as per this discussion on the google groups, that doesn't work either. after running the command gcloud auth login I get the same error as posted above.

解决方案

This is a very easy thing to solve. The native python command on the Arch command line is actually for Python 3. The SDK requires Python2.7 and the

  • Just go to the google-cloud-sdk folder and open the install.sh file.

  • Change the CLOUDSDK_PYTHON="python" value to CLOUDSDK_PYTHON="python2.7"

  • Rerun the install with the command

    ./install.sh

    in the same folder and follow the prompts.

That's all.

这篇关于谷歌云sdk:设置环境variable_ python - > Linux的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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