gcloud not recognized as an internal or external c

2019-02-12 08:56发布

I am installing Google App Engine under Windows (not using Cygwin). After running the bat script, I closed and reopened the cmd.exe and entered inside the google-cloud-sdk directory. When I ran the command gcloud auth login, I'm getting the error:

'gcloud' is not recognized as an internal or external command,
operable program or batch file.

14条回答
我命由我不由天
2楼-- · 2019-02-12 09:10

just below path in environment variables there is PATHEXT, have to add .PY to it, as the gcloud is gcloud.py,

also have to add

C:\Program Files\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\gcloud;

C:\Program Files\Google\Cloud SDK\google-cloud-sdk.staging\lib\googlecloudsdk\gcloud

to the environmental variable path.

查看更多
Viruses.
3楼-- · 2019-02-12 09:15

Like Domenic called out, I was missing the /bin folder because of the corporate proxy.

I followed these steps:

set http_proxy=<<your_http_proxy>>
set https_proxy=<<your_https_proxy>>
cd "c:\Program Files\Google\Cloud SDK"
c:\Python27\python.exe google-cloud-sdk\install_google_cloud_sdk.py --install-directory .

The installation completed successfully but it wasn't added to the PATH environment variable, so I had to manually add "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\" to it.

查看更多
在下西门庆
4楼-- · 2019-02-12 09:22

In my case, it's because my laptop connect to internet using corporate proxy when install google cloud. I assume the proxy block connection to google cloud installation file.

So, I try to re-install with my own internet connection and the problem solved

查看更多
相关推荐>>
5楼-- · 2019-02-12 09:22

None of the above helped on Windows 8.1 64 bit. Because the SDK is 32 bit and it installs 64 bit Python.

I solved this by uninstalling the SDK and Python, removing folders. I downloaded python 32 bit, installed it and then the SDK and it worked.

查看更多
Ridiculous、
6楼-- · 2019-02-12 09:24

I am having the same Issue but fortunately I've got it resolved :)

First thing gcloud is actually gcloud.py so you have to fix this by adding .py to PATHTEXT environment variable, second try to locate gcloud.py by searching inside the C:\Program Files\Google\Cloud SDK\google-cloud-sdk mine happened to be in this path C:\Program Files\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\gcloud copy it and add it to PATH environment variable

As steps:

  1. Go to control panel and type environment into search and click Edit the system environment variables
  2. Click on environment variables button
  3. Edit PATHTEXT add: ;.py
  4. Edit PATH add the path for gcould, mine be like: ;C:\Program Files\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\gcloud

hopefully everything will workout for you

查看更多
不美不萌又怎样
7楼-- · 2019-02-12 09:28

In my case, I had a folder gClould and gCloud.staging after updating. I could not remove the gCloud folder so I closed all my apps first, then renamed the folder, and changed the gCloud.staging to gCloud. Everything worked after that. For some, this could be your problem, especially it was working before.

Good luck!

查看更多
登录 后发表回答