gcloud not recognized as an internal or external command on Windows

后端 未结 17 1518
别那么骄傲
别那么骄傲 2020-12-17 10:07

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

相关标签:
17条回答
  • 2020-12-17 10:17

    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.

    0 讨论(0)
  • 2020-12-17 10:19

    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

    0 讨论(0)
  • 2020-12-17 10:20

    For me I had to add the following path to my Environment system path:

    C:\Users\<my windowns username>\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin
    
    0 讨论(0)
  • 2020-12-17 10:21

    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.

    0 讨论(0)
  • 2020-12-17 10:22

    I just tried it again and I found the issue.

    C:\google-cloud-sdk\bin is not added in the system variable path. I added that it's working fine now.

    0 讨论(0)
  • 2020-12-17 10:24

    If you don't even have the /bin folder, chances are you are on a corporate network that uses a proxy server to get to the Internet and the SDK did not get installed properly. This gets further compounded if you use a PAC to configure your proxy settings. The SDK installer doesn't give you any indication of a failure when installing. You should have a file called install_google_cloud_sdk.py though. On the command line, run python install_google_cloud_sdk.py --install-directory [install dir].

    After a few moments you'll see detailed errors that may help you determine your next steps or it could just hang indefinitely. Below is an example of what I originally experienced.

    Traceback (most recent call last):
      File "install_google_cloud_sdk.py", line 90, in <module>
        main()
      File "install_google_cloud_sdk.py", line 74, in main
        archive_path = DownloadArchive(t, url)
      File "install_google_cloud_sdk.py", line 54, in DownloadArchive
        req = urllib2.urlopen(url)
      File "C:\python27_x64\lib\urllib2.py", line 127, in urlopen
        return _opener.open(url, data, timeout)
      File "C:\python27_x64\lib\urllib2.py", line 404, in open
        response = self._open(req, data)
      File "C:\python27_x64\lib\urllib2.py", line 422, in _open
        '_open', req)
      File "C:\python27_x64\lib\urllib2.py", line 382, in _call_chain
        result = func(*args)
      File "C:\python27_x64\lib\urllib2.py", line 1222, in https_open
        return self.do_open(httplib.HTTPSConnection, req)
      File "C:\python27_x64\lib\urllib2.py", line 1181, in do_open
        h.request(req.get_method(), req.get_selector(), req.data, headers)
    

    I had to change my Internet proxy from the PAC file to a named server and port. Apparently the python interpreter does not handle PAC configurations very well.

    0 讨论(0)
提交回复
热议问题