Python - 错误 - 无法将数据写入流:<打开文件'<stdout>',模式'w'位于0x104c8f150>

Fer*_*nte 12 python django

我正在从CSV文件中导入数据,输入210行后,它会返回此错误.我是从Django shell(manage.py shell)这样做的

ERROR - failed to write data to stream: <open file '<stdout>', mode 'w' at 0x104c8f150>
Run Code Online (Sandbox Code Playgroud)

lec*_*ito 31

这是IPython编码不是UTF-8的问题.export PYTHONIOENCODING=UTF-8会解决它.

  • 应该标记为答案.这样做了! (2认同)