Search code examples
gcloudgsutil

why can't gsutil find the python executable in powershell?


So I installed the Google Cloud SDK on Windows 10 and gsutil can't seem to find/see the python executable:

~> gsutil help cp
ERROR: (gsutil) "C:\Python38\python.exe": command not found
~>

The executable is in exactly that place and works fine:

~> where.exe python
C:\Python38\python.exe
C:\Users\omort\AppData\Local\Microsoft\WindowsApps\python.exe
~>

The second python exe is the link that opens the python page in the MS Store - is that screwing things up? Any suggestions?

Note that I did not install the "bundled python" option in the SDK installer since I already have python installed.


Solution

  • It seems like your CLOUDSDK_PYTHON env variable is not set correctly. I would recommend you to set correctly the env variable executing something like the below

    set CLOUDSDK_PYTHON="C:\Python38\python.exe"
    

    Or in case you want to set permanently use the below command

    setx CLOUDSDK_PYTHON="C:\Python38\python.exe"