Error when starting Python in Windows

Error message

Start Python 3.6 in the windows command line environment and report the following error

Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Failed calling sys.__interactivehook__
Traceback (most recent call last):
  File "C:\Anaconda3\lib\", line 418, in register_readline
  File "C:\Anaconda3\lib\site-packages\pyreadline\", line 165, in read_history_file
  File "C:\Anaconda3\lib\site-packages\pyreadline\lineeditor\", line 82, in read_history_file
    for line in open(filename, 'r'):
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 407: illegal multibyte sequence

terms of settlement

The way to solve this problem is to modify the corresponding code in line 82 of the file C: \ anaconda3 \ lib \ site packages \ pyreadline \ lineeditor \ history. Py , add the coding format as UTF-8 , and then restart python.

Reference articles

Read More: