I'm trying to install Google Cloud SDK in ubuntu, but getting an error:
[root@localhost google-cloud-sdk]# ./install.sh
Welcome to the Google Cloud SDK!
File "/home/marilu/google-cloud-sdk/bin/bootstrapping/install.py", line 182
with open(rc_path) as rc_file:
^
SyntaxError: invalid syntax [root@localhost google-cloud-sdk]#
I have installed Python; this is how it looks
[root@localhost marilu]# ls -l
drwxr-xr-x 5 marilu marilu 4096 Apr 8 11:35 google-cloud-sdk
drwxrwxr-x 19 marilu marilu 4096 Apr 23 09:08 Python-2.7.6
[root@localhost marilu]#
Can someone help me? Why this error?
1 Download and install Google Cloud SDK by running the following command in your shell or Terminal:
curl https://dl.google.com/dl/cloudsdk/release/install_google_cloud_sdk.bash | bash
2 Restart your shell or Terminal.
3 Authenticate to Google Cloud Platform by running gcloud auth login.
Did you try that?
As at the time of writing, the install.sh and install.py require Python 2.7, and I have observed a similar error when the default/system Python is version 3+. You can confirm that by running python --version.
You have several ways to work around this:
export CLOUDSDK_PYTHON=/path/to/python2.7
Then source ~/.bashrc and rerun install.py
or 2. Create a python2.7 Virtual Environment, activate it, and then run install.sh
You can find the location of the installed python2.7 executable by running which python2.7.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With