Conda解析环境报错gbk编码错误误
运行环境 Link to heading
Windows 11 Anaconda 3
问题描述 Link to heading
Exception in thread Thread-7 (_readerthread):
Traceback (most recent call last):
r
self.run()
File "D:\Python\anaconda3\Lib\threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "D:\Python\anaconda3\Lib\subprocess.py", line 1596, in _readerthread
buffer.append(fh.read())
^^^^^^^^^
UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 1223: illegal multibyte sequence
Unexpected cygpath error, fallback to manual path conversion
AttributeError: 'NoneType' object has no attribute 'strip'
解决方法 Link to heading
Windows系统的区域设置 Link to heading
打开控制面板
点击时钟和区域
点击区域
在区域对话框中,点击管理标签页
点击更改系统区域设置
选择Beta版:使用 Unicode UTF-8 提供全球语言支持(U)选项,然后点击确定
重启电脑
这一步将系统的区域设置更改为使用UTF-8编码。
修改环境变量(未解决) Link to heading
在环境变量中添加PYTHONIOENCODING,值为utf-8。