美文网首页
Ubuntu 16.04 初始化GCP SDK出现错误 'asc

Ubuntu 16.04 初始化GCP SDK出现错误 'asc

作者: empires2 | 来源:发表于2018-03-07 14:35 被阅读0次

日前,在Ubuntu16.04上安装Google Cloud Platfrom SDK后,对GCP gcloud进行初始化时,出现了如下错误:

czhcheng@ThinkCentre:~$ gcloud init
Welcome! This command will take you through the configuration of gcloud.

...

ERROR: gcloud crashed (UnicodeDecodeError): 'ascii' codec can't decode byte 0xbb in position 1: 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

经搜索后,发现错误出现在google-cloud-sdk/lib/third_party/socks/__init__.py第262行

req = req + struct.pack(">H", destport)

改为:

if isinstance(req, unicode):
    req = req.encode('UTF-8')
req = req + struct.pack(">H", destport)

之后,重新运行:

$ gcloud init

一切正常.

所用GCP SDK版本如下:

~$ gcloud version
Google Cloud SDK 191.0.0
bq 2.0.29
core 2018.02.23
gsutil 4.28

相关文章

网友评论

      本文标题:Ubuntu 16.04 初始化GCP SDK出现错误 'asc

      本文链接:https://www.haomeiwen.com/subject/ycpjfftx.html