python: Failed calling sys.__interactivehook__ (Windows)
生活随笔
收集整理的這篇文章主要介紹了
python: Failed calling sys.__interactivehook__ (Windows)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
python: Failed calling sys.__interactivehook__ (Windows)
進入 python 解釋器 時出現 Failed calling sys.__interactivehook__ 錯誤
Microsoft Windows [版本 10.0.19042.508] (c) 2020 Microsoft Corporation. 保留所有權利。C:\Users\14298>python Python 3.8.3 (default, Jul 2 2020, 17:30:36) [MSC v.1916 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 "D:\software\Environment\Anaconda3\lib\site.py", line 440, in register_readlinereadline.read_history_file(history)File "D:\software\Environment\Anaconda3\lib\site-packages\pyreadline\rlmain.py", line 165, in read_history_fileself.mode._history.read_history_file(filename)File "D:\software\Environment\Anaconda3\lib\site-packages\pyreadline\lineeditor\history.py", line 82, in read_history_filefor line in open(filename, 'r'): UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 536: illegal multibyte sequence >>>問題來源:讀取某個文件,其中包含了無法解析的編碼(BGK,中文)
解決辦法:將 C:\Users\{username} 目錄下的 .python_history 文件里面的中文刪除
總結
以上是生活随笔為你收集整理的python: Failed calling sys.__interactivehook__ (Windows)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Windows下 更改 pip默认缓存目
- 下一篇: windows10 下 用图片手把手教你