anaconda 前几天运行的好好的,突然报错不能初始化了
报错如下
Traceback (most recent call last):
File "E:\anaconda\lib\site-packages\conda\cli\main.py", line 140, in main
return activator_main()
File "E:\anaconda\lib\site-packages\conda\activate.py", line 1210, in main
print(activator.execute(), end ='')
UnicodeEncodeError: 'gbk' codec can't encode character '\u202a' in position 1258: illegal multibyte sequence
解决方法:
1、定位报错路径
“E:\anaconda\lib\site-packages\conda\cli\main.py”, line 140
“E:\anaconda\lib\site-packages\conda\activate.py”, line 1210
print(activator.execute(), end ='')
2、错误类型
编码的错误
'gbk' codec can't encode character '\u202a'
3、解决办法
print(activator.execute().encode('gbk','ignore').decode('gbk'), end ='')
instead of
print(activator.execute(), end ='')
work!!