2023-06-10 Troubleshoot UnicodeEncodeError: 'cp932' codec can't encode character '镜' in position 37: illegal multibyte sequence Windows下,Python文件写入的时候遇到cp932无法处理的字符报错 1234# 文件写入 with open(fname, 'w') as result_file:UnicodeEncodeError: 'cp932' codec can't encode character '\u955c' in position 37: illegal multibyte sequence 解决方法12# 文件写入时制定UTF-8编码 with open(fname, 'w', encoding='UTF-8') as result_file: 前一篇 macOS下,Python3安装virtualenv 后一篇 nerf-pytorch执行示例报错:TypeError: type torch.cuda.FloatTensor not available. Torch not compiled with CUDA enabled. - MacStudio M1