只修改E:\dbd\software\tool\anaconda\Lib\site-packages\pyreadline\lineeditor\history.py 第84行添加 encoding='utf-8'

 

下面是完整报错内容,我只修改了上文的一个地方就好了

 

python
Python 3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
Failed calling sys.__interactivehook__
Traceback (most recent call last):
  File "E:\dbd\software\tool\anaconda\lib\site.py", line 439, in register_readline
    readline.read_history_file(history)
  File "E:\dbd\software\tool\anaconda\lib\site-packages\pyreadline\rlmain.py", line 165, in read_history_file
    self.mode._history.read_history_file(filename)
  File "E:\dbd\software\tool\anaconda\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 0x81 in position 958: illegal multibyte sequence

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐