Sterling Butters
Sterling Butters

Reputation: 1175

Installing Google Cloud SDK with Python 2.7

I am trying to install the Google Cloud SDK which requires Python 2.7. I have both Python 3.5 and 2.7 with Anaconda. I am given a shell script and I would like to tell the shell script to use Python 2.7. How would I do this?

Upvotes: 2

Views: 3460

Answers (3)

David Lee
David Lee

Reputation: 1

add the varable for python path

window+R -> sysdm.cpl ,3 -> advance tap -> evieronmetal varables

New click

  • varable name :"CLOUDSDK_PYTHON"
  • path : "C:\Users\aaa\AppData\Local\Programs\Python\Python3\python.exe"

Upvotes: 0

cherba
cherba

Reputation: 8980

You can change which version of python gcloud is using by setting environment variable

export CLOUDSDK_PYTHON=path/to/python2.7

then you can run install.sh.

Note that you should have this environment variable set every time you use gcloud, so you might want to set it permanently for your shell.

Upvotes: 4

Dominic Woodman
Dominic Woodman

Reputation: 839

An additional thing to add to @cherba's answer:

On Windows I found CLOUDSDK_PYTHON had to be a user level variable not a system level variable. (That's the first box if you're looking at windows system environment variables.)

Upvotes: 2

Related Questions