在vs code想退出虚拟环境前往bash,使用的环境管理工具是Conda,所以使用指令conda deactivate来退出虚拟环境,但意外的是出现了错误,ERROR REPORT如下:
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "/Users/namit/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 98, in main
return activator_main()
File "/Users/namit/anaconda3/lib/python3.6/site-packages/conda/activate.py", line 632, in main
print(activator.execute(), end='')
UnicodeEncodeError: 'gbk' codec can't encode character '\ue161' in position 1187: illegal multibyte sequence
根据提示,deactivate.py读取的信息里包含未知字符,无法识别所以py文件无法运行
解决方法是在windows环境变量里添加PYTHONIOENCODING-utf_8_sig