I got this error when running python from command line on Windows 10:
C:Userswindows> python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Failed calling sys.__interactivehook__
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite.py", line 410, in register_readline
readline.read_history_file(history)
File "C:ProgramDataAnaconda3libsite-packagespyreadline
lmain.py", line 165, in read_history_file
self.mode._history.read_history_file(filename)
File "C:ProgramDataAnaconda3libsite-packagespyreadlinelineeditorhistory.py", line 82, in read_history_file
for line in open(filename, 'r'):
File "C:ProgramDataAnaconda3libencodingscp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 991: character maps to <undefined>
I have not changed anything about my python environment, I was just running some scripts that I've been working on for the last week. I honestly have no idea where this could be coming from; it seems to be an issue when python reads in its history. Updating python and conda did nothing. I found a very similar issue on a Chinese site here but the solution is unhelpful.
At the moment, I cannot find any issues when continuing to run python or my scripts, but I don't want this to come back and bite me. Any help is appreciated!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…