当cmd打开anaconda的python3.7.3,和我电脑一样出现下面情况:
Failed calling sys.__interactivehook__
Traceback (most recent call last):
File "H:\anaconda3\lib\site.py", line 439, in register_readline
readline.read_history_file(history)
File "H:\anaconda3\lib\site-packages\pyreadline\rlmain.py", line 165, in read_history_file
self.mode._history.read_history_file(filename)
File "H:\anaconda3\lib\site-packages\pyreadline\lineeditor\history.py", line 82, in read_history_file
for line in open(filename, 'r'):
UnicodeDecodeError: 'gbk' codec can't decode byte 0x90 in position 683: illegal multibyte sequence

解决办法
1.在该目录下Anaconda3\Lib\site-packages\pyreadline\lineeditor找到 history.py文件
2.history.py文件的第82行,修改如下:for line in open(filename, 'r',encoding='utf-8'):
在原有的open函数里 新增了一个参数选项encoding='utf-8'
我是用记事本打开的,然后再打开cmd,在控制台运行python,就不会出现如上情况了