[Fixed]-Python – ERROR – failed to write data to stream: <open file '<stdout>', mode 'w' at 0x104c8f150>

34👍

This is a problem with the IPython encoding that is not UTF-8. export PYTHONIOENCODING=UTF-8 will solve it.

1👍

This did the trick.

# sys.setdefaultencoding() does not exist, here!
import sys
reload(sys)  # Reload does the trick!
sys.setdefaultencoding('UTF-8')

Leave a comment