I get this error message when running install.bat (or install.sh through 'bash' shell) of google-cloud-sdk. Python is version 3.6.
Any suggestions?
I get this error message when running install.bat (or install.sh through 'bash' shell) of google-cloud-sdk. Python is version 3.6.
Any suggestions?
You need Python 2.7 to use gcloud, as described in https://cloud.google.com/sdk/docs/#windows.
On windows you can choose to use "bundled python" option in which case gcloud will use its own version of python 2.7 without interfering with your installed version.
There is a new reason for this error after a recent upgrade to Google Cloud SDK 303.0.0; gcloud (the start script in sdk/bin) prefers python3 and detects it and uses it (on MacOS), but that error shows. Just use the following line until Google has fixed the problem:
export CLOUDSDK_PYTHON="python2"
Another reason can be that the variable PYTHONPATH is set incorrectly. Try: unset PYTHONPATH
before starting python.
Ensure two things:
While installing the GoogleCloudSDK, check the 'BundledPython' option. It will install both python and python3.
Make sure your environment variable-PYTHONPATH is pointing to the directory having the python.exe file.
This worked out for me.