why am i getting (gsutil): “C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe”: command not found

冷暖自知 提交于 2020-04-17 06:25:39

问题


After installing Google cloud sdk and connecting to desired firebase project i am receiving :

ERROR: (gsutil) "C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe": command not found when running any gsutil command.

My current stup is:

windows 10
Google Cloud SDK 281.0.0
bq 2.0.53
core 2020.02.14
gsutil 4.47
python 3.7

My theory is, that while installed "correctly" python doesnt have access to gsutil commands


回答1:


To see a list of components that are available and currently installed, run command:

gcloud components list

To update all installed components to the latest available version(282.0) of Cloud SDK, run command:

gcloud components update

You also can reinstall it following this document, while Cloud SDK currently uses Python 2 by default, you can use an existing Python installation if necessary by unchecking the option to 'Install Bundled Python'.




回答2:


As was suggested above reinstalling using bundled python worked for me. I had incorrectly assumed from google's doc i should choose between bundled or current python install not realizing both could run without conflict.




回答3:


I had the same problem and I was able to solve it by setting a new environment variable for CLOUDSDK_PYTHON. On windows 10 you can do this from the command line in 2 ways:

  1. Set an env variable for the current terminal session set CLOUDSDK_PYTHON="C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe"

  2. Set a permanent env variable setx CLOUDSDK_PYTHON="C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe"

The file path will probably be different for everyone, so check first where is python.exe located and use your own path. I hope this helps.



来源:https://stackoverflow.com/questions/60405013/why-am-i-getting-gsutil-c-users-user-appdata-local-programs-python-python37

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!