使用 pyinstaller 後,突然發現
Python 3.9.7 (default, Sep 16 2021, 16:59:28) [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 “C:\ProgramData\Anaconda3\lib\site.py”, line 449, in register_readline
readline.read_history_file(history)
File “C:\ProgramData\Anaconda3\lib\site-packages\pyreadline\rlmain.py”, line 165, in read_history_file
self.mode._history.read_history_file(filename)
File “C:\ProgramData\Anaconda3\lib\site-packages\pyreadline\lineeditor\history.py”, line 82, in read_history_file
for line in open(filename, ‘r’):
UnicodeDecodeError: ‘cp950’ codec can’t decode byte 0xb3 in position 3656: illegal multibyte sequence
解決辦法:
1.刪除使用者目錄下之
刪除這個 .python_history 檔案
這樣就OK了