Python。 OSError: raw write() returned invalid length xx (should have been between xx and xx)

在python的print, write等语句中,有时会出现上面一个OSError: raw write() returned invalid length xx (should have been between xx and xx)。而且有时会在安装过程中出现。。。主要是调用到系统IO时会出错。
解决办法:
在出现该问题(也就是IO语句所在文件,或者直接在最开始运行的python文件头引入
import win_unicode_console
win_unicode_console.enable()
再次运行即可(没安装win_unicode_console的pip安装一下)。


参考博客: Python问题解决:OSError: raw write() returned invalid length 14 (should have been between 0 and 7)


你可能感兴趣的:(Bugs)