Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

trouble installing Google Cloud SDK in ubuntu

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?

like image 924
Marilu Avatar asked Apr 23 '14 14:04

Marilu


2 Answers

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?

like image 183
Samantha Avatar answered Nov 01 '22 12:11

Samantha


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:

  1. Set an environment variable to tell install.sh which python to use, i.e. add the following line to ~/.bashrc:

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.

like image 1
Chris Avatar answered Nov 01 '22 10:11

Chris