gpt4 book ai didi

python - 在 Anaconda Prompt 中运行 Python 时出现 UnicodeDecodeError

转载 作者:行者123 更新时间:2023-12-04 17:37:32 27 4
gpt4 key购买 nike

当我在 Anaconda Prompt 中运行 python 时,出现以下错误。它不会以任何可见的方式破坏我的 Python 体验,但无论如何它仍然让我感到不安。

知道为什么会这样吗?

我正在使用 2019/03 版本的 Anaconda 和 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>

最佳答案

del %userprofile%\.python_history 删除了无法为我显示的字符的Python历史文件并解决了问题。

关于python - 在 Anaconda Prompt 中运行 Python 时出现 UnicodeDecodeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56105900/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com