linux maniac
linux maniac

Reputation: 85

GCP Cloud SDK install fails in MAC

Unable to install gcloud sdk using package "google-cloud-sdk-307.0.0-darwin-x86_64.tar.gz" downloaded from gcloud. Supported Python versions are 3.5 to 3.7, and 2.7.9 or higher

Does it mean Python 3.7.4 is not supported?

enter code here

$ python3 -V
Python 3.7.4

$ which -a python3
/usr/local/bin/python3
/usr/bin/python3

$ ./google-cloud-sdk/install.sh
Welcome to the Google Cloud SDK!
Traceback (most recent call last):
  File "/Users/spalani/Documents/DownloadPackages/./google-cloud-sdk/bin/bootstrapping/install.py", line 12, in <module>
    import bootstrapping enter code here
  File "/Users/spalani/Documents/DownloadPackages/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 39, in <module>
    from googlecloudsdk.core import config
  File "/Users/spalani/Documents/DownloadPackages/google-cloud-sdk/lib/googlecloudsdk/core/config.py", line 33, in <module>
    from oauth2client import client
  File "/Users/spalani/Documents/DownloadPackages/google-cloud-sdk/lib/third_party/oauth2client/client.py", line 39, in <module>
    from oauth2client import transport
  File "/Users/spalani/Documents/DownloadPackages/google-cloud-sdk/lib/third_party/oauth2client/transport.py", line 17, in <module>
    import httplib2
  File "/Users/spalani/Documents/DownloadPackages/google-cloud-sdk/lib/third_party/httplib2/__init__.py", line 20, in <module>
    from httplib2.python3.httplib2 import *
  File "/Users/spalani/Documents/DownloadPackages/google-cloud-sdk/lib/third_party/httplib2/python3/httplib2/__init__.py", line 40, in <module>
    import ssl
  File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 98, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: dlopen(/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so
  Reason: image not found

Upvotes: 4

Views: 2505

Answers (1)

Jose Luis Delgadillo
Jose Luis Delgadillo

Reputation: 2468

Regarding your question “Does it mean Python 3.7.4 is not supported?” According to this document:

Cloud SDK runs on Linux, macOS, and Windows. Cloud SDK requires Python. Supported versions are 3.5 to 3.7, and 2.7.9 or higher.

So, it seems that it is supported for the Cloud SDK installation.

On the other hand, I have found the following guide to configure the Python interpreter, it could help you to set it properly.

Also, It appears that the recommended option to install SDK on MacOS is through the interactive installer.

For Windows and macOS interactive installations, and all other use cases, run the interactive installer to install the latest release of Cloud SDK.

The steps to install it using the Google Cloud SDK installer are:

  1. Enter the following at a command prompt:

curl https://sdk.cloud.google.com | bash

  1. Restart your shell:

exec -l $SHELL

  1. Run gcloud init to initialize the gcloud environment:

gcloud init

I hope you find this information useful.

Upvotes: 8

Related Questions