google cloud sdk: set environment variable_ python --> linux

心已入冬 提交于 2019-12-04 05:58:25

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.

gkumar

I had the same issue so I did a little change in the dev_appserver.py. This file is in the following path :

google-cloud-sdk/bin

change the shebang from /usr/bin/env python to /usr/bin/env python2

I see this almost every time I update gcloud SDK, especially when running dev_appserver.py <my app config yaml file>

I found that setting the CLOUDSDK_PYTHON env variable to 'python2' seems to silence the error. E.g on macOS:

export CLOUDSDK_PYTHON=python2

Not sure why they simply cannot make this dev server compatible with Python 3 already

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!