4

When I run python in Anaconda Prompt, I get the following error. It does not disrupt my Python experience in any visible way, but it still unnerves me regardless.

Any idea on why this is happening?

I'm using 2019/03 version of Anaconda with Python 3.7.3

(base) C:\Users>python
Python 3.7.3 (default, Mar 27 2019, 17:13:21) [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 "C:\Users\Anaconda3\lib\site.py", line 439, in register_readline
    readline.read_history_file(history)
  File "C:\Users\Anaconda3\lib\site-packages\pyreadline\rlmain.py", line 165, in read_history_file
    self.mode._history.read_history_file(filename)
  File "C:\Users\Anaconda3\lib\site-packages\pyreadline\lineeditor\history.py", line 82, in read_history_file
    for line in open(filename, 'r'):
  File "C:\Users\Anaconda3\lib\encodings\cp1252.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 2990: character maps to <undefined>
3
  • check 0x81 in internet to see what char it is and in which encoding. Commented May 13, 2019 at 4:54
  • 3
    See stackoverflow.com/q/52049887/5320906 Commented May 14, 2019 at 7:01
  • Solved! Glad it was nothing serious...! Commented May 15, 2019 at 21:01

1 Answer 1

2

del %userprofile%\.python_history deleted the Python history file with the character that could not be displayed for me and solved the issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.