Google Cloud SDk: Python was not found
Apr 21
After I install Google cloud sdk in my computer, I open the terminal and type "gcloud --version" but it says "python was not found"
note: I unchecked the box saying "Install python bundle" when I install Google cloud sdk because I already have python 3.10.2 installed.
so, how do fix this?
Thanks in advance.
1 answer
Accepted answer · original discussion
Apr 21
As mentioned in the document:
Cloud SDK requires Python; supported versions are Python 3 (preferred, 3.5 to 3.8) and Python 2 (2.7.9 or later). By default, the Windows version of Cloud SDK comes bundled with Python 3 and Python 2. To use Cloud SDK, your operating system must be able to run a supported version of Python.
As suggested by @John Hanley the CLI cannot find Python which is already installed. Try reinstalling the CLI selecting install Python bundle. If you are still facing the issue another workaround can be to try with Python version 2.x.x .
You can follow the below steps :
1.Uninstall all Python version 3 and above.
2.Install Python version -2.x.x (I have installed - 2.7.17)
3.Create environment variable - CLOUDSDK_PYTHON and provide value as C:\Python27\python.exe
4.Run GoogleCloudSDKInstaller.exe again.
3 question comments
Use comments to ask for clarification. Post a solution as an answer.
Apr 21
CLOUDSDK_PYTHON and point it to your Python3 installationApr 26