5

if I run:

sudo gcloud components update

I get this warning:

WARNING: Python 3.4.x is no longer officially supported by the Google Cloud SDK and may not function correctly. Please use Python version 2.7.x or 3.5 and up.

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

My linux machine is Centos6 and my current python default versions are these:

myshell$ python --version
Python 2.6.6
myshell$ python3 --version
Python 3.4.10

I installed a Python 3.6 version, which is located here:

/opt/rh/rh-python36/root/usr/bin/python

myshell$ /opt/rh/rh-python36/root/usr/bin/python --version
Python 3.6.9

I hence added this line to the .bash_profile and sourced it:

export CLOUDSDK_PYTHON=/opt/rh/rh-python36/root/usr/bin/python

but I still get the same warning when running gcloud commands

Can anyone explain what am I doing wrong?

Daniele B
  • 19,801
  • 29
  • 115
  • 173

2 Answers2

4

I think you can solve it do it the described here.

*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
Samuel Romero
  • 1,233
  • 7
  • 12
2

For me following statement worked

export CLOUDSDK_PYTHON=python3.8

I set 3.8 as for me error was "Pleases use Python version 3.5 or up"

Ritesh
  • 1,053
  • 5
  • 16
  • 29