Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud App SDK crash → cloud crashed (LookupError): unknown encoding cp65001

I get App Engine from https://cloud.google.com/sdk/docs/
After install, I cant run gsutil init or gcloud info --run-diagnostics in Google Clood SDK Shell or Windows Powershell, it ends with this error:

Welcome! This command will take you through the configuration of gcloud.

Your current configuration has been set to: [default]

You can skip diagnostics next time by using the following flag:
  gcloud init --skip-diagnostics

Network diagnostic detects and fixes local network connection issues.
ERROR: gcloud crashed (LookupError): unknown encoding: cp65001

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

I had UTF-8 set as the encoding:

[Console]::OutputEncoding
BodyName          : utf-8
EncodingName      : Unicode (UTF-8)
HeaderName        : utf-8
WebName           : utf-8
WindowsCodePage   : 1200
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
IsSingleByte      : False
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : True
CodePage          : 65001

I've tried all this answers, but it didn't help → gsutil command crashes every time on Windows 10, LookupError: unknown encoding: cp0, Python 2.7 : LookupError: unknown encoding: cp65001

I've tried install Python 3.7, 2.7.9 and "Bundled Python".

like image 809
Konstantin Gorshenev Avatar asked Sep 27 '18 15:09

Konstantin Gorshenev


People also ask

What is cp65001 encoding?

Show activity on this post. The error means that Unicode characters that your script are trying to print can't be represented using the current console character encoding.


1 Answers

You can try running:

set PYTHONIOENCODING=UTF-8

Or, create an environment variable with the name 'PYTHONIOENCODING' and value 'UTF-8'.

It solves the problem for me.

like image 159
Jee Mok Avatar answered Sep 22 '22 05:09

Jee Mok