2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Windows10版Google Cloud SDK(Bundled Python)セットアップ時のデコードエラー問題の解決法

Posted at

#恐らく直面してる問題
きっとこんなん↓↓↓

エラー文
UnicodeDecodeError: 'ascii' codec can't decode byte ....

##解決法

###①Bundled Pythonは諦めて別途python2をインストールする

python2をインストールして(python3はダメダメ)Pathを通す。

###②Pythonの初期エンコーディングをasciiからshift-jisに変更する

真打登場。
Python27\Lib\site-packagesに↓を作る。

sitecustomize.py
import sys
sys.setdefaultencoding("hoge")

[重要] ↑↑↑ の"hoge"を覚えのある色々な文字コードに替えて③を試す。
ちなみに筆者は"utf-8"→"shift-jis"→"cp932"と試して3回目で成功。(諦めないで。)

##③Google Cloud SDK再セットアップ

[超重要]BundledPythonはチェック外すの忘れないように!!!

キャプチャ.PNG

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?