The error contents are as follows:
Python 3.7.10 | packaged by conda-forge | (default, Feb 19 2021, 15:37:01) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Failed calling sys.__interactivehook__
Traceback (most recent call last):
File "D:\Users\Admin\Anaconda3\envs\tff2\lib\site.py", line 439, in register_readline
readline.read_history_file(history)
File "D:\Users\Admin\Anaconda3\envs\tff2\lib\site-packages\pyreadline\rlmain.py", line 165, in read_history_file
self.mode._history.read_history_file(filename)
File "D:\Users\Admin\Anaconda3\envs\tff2\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 0xa5 in position 1508: illegal multibyte sequence
Solution:
# Find the history file with the following path.
D:\anaconda3\Lib\site-packages\pyreadline\lineeditor\history.py
# If the problem is with a particular environment, the path is
D:\anaconda3\envs\**\Lib\site-packages\pyreadline\lineeditor\history.py
# Modify codes
Line 82
Change for line in open(filename, 'r'):
to for line in open(filename, 'r', encoding='utf-8'):
Similar Posts:
- [Solved] Exception: Jupyter command `jupyter-notbook` not found.
- [Solved] Error caused by correspondence between tensorflow GPU version number and CUDA
- [Solved] requests.exceptions.InvalidSchema: No connection adapters were found for
- pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it’s not in you…
- [Solved] Pytoch nn.CrossEntropyLoss Error: RuntimeError: expected scalar type Long but found Float
- [Solved] Python Error: UnicodeDecodeError: ‘gb2312’ codec can’t decode byte 0xa4 in position… : illegal multibyte sequence
- [Solved] torch.cuda.CudaError: CUDA driver version is insufficient for CUDA runtime version (35) [ WARN:0
- django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named ‘M…
- python3 are installed through pip on Win 10, Unicode decodeerror: ‘UTF-8’ codec can’t decode byte
- Error report of cell timed task startup: KeyError: ‘scheduler’ KeyError: ‘entries’