Google Cloud SDK installer fails on Windows 7 (gcloud crashed (UnicodeDecodeError))

白昼怎懂夜的黑 提交于 2019-12-06 07:14:13

问题


My OS is win7. I want to install the clould SDK. But it "Failed to install". The ERROR message is:

Output folder: C:\Program Files (x86)\Google\Cloud SDK
Downloading Google Cloud SDK core.
Extracting Google Cloud SDK core.
Create Google Cloud SDK bat file: C:\Program Files (x86)\Google\Cloud SDK\cloud_env.bat
Installing components.
Welcome to the Google Cloud SDK!
ERROR: gcloud crashed (UnicodeDecodeError): 'ascii' codec can't decode byte 0xa4 in position 9: ordinal not in range(128)
If you would like to report this issue, please run the following command:
  gcloud feedback
To check gcloud for common problems, please run the following command:
  gcloud info --run-diagnostics
ERROR: Cannot use bundled Python installation to update Cloud SDK in
non-interactive mode. Please run again in interactive mode.
If you really want to run in non-interactive mode, please run the
following command before re-running this one:
 FOR /F "delims=" %i in ( '""C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd"" components copy-bundled-python'
 ) DO (
SET CLOUDSDK_PYTHON=%i
)
(Substitute `%%i` for `%i` if in a .bat script.)
Failed to install.

Can someone help me?


回答1:


I Fixed it by re-installing google cloud sdk. (if you can't uninstall just rename folder: C:\Program Files (x86)\Google\Cloud SDK to something else and try installer)

And by setting the CLOUDSDK_PYTHON environment variable to C:\Python27\python.exe (installation folder of python v2.7)

Now installing the app-engine components worked again.

option 2

Check your config: gcloud config list if you see: disable_prompts = True. this is probably why google says the inter-active mode is disabled. if you remove this value it might remove this error.




回答2:


I also had error on Windows 8

ERROR: gcloud failed to load: 'ascii' codec can't decode byte...

  1. I checked my installation path. And it contained non-ascii symbol. So I restarted installer and changed installation path to C:\Program Files\Google\Cloud SDK

Afterwards I've got error

To use the Google Cloud SDK, you must have Python installed and on your PATH. As an alternative, you may also set the CLOUDSDK_PYTHON environment variable to the location of your Python executable. Failed to install.

despite the checked option "Bundled Python" as manual proposes.

  1. I downloaded from https://www.python.org/downloads/release/python-2714/ and installed latest Python 2.7.14 (Google SDK doesn't work with Python 3)

  2. The default path to executable was C:\Python27\python.exe, so added it as CLOUDSDK_PYTHON system variable in my Control panel and started again.

Finally it is installed.




回答3:


My local account name contains non-ASCII characters.

I workarounded this issue by creation of new local account with name of ASCII characters only.



来源:https://stackoverflow.com/questions/42895848/google-cloud-sdk-installer-fails-on-windows-7-gcloud-crashed-unicodedecodeerro

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