import sys sys.setdefaultencoding('utf-8') import os os.putenv('LANG', 'en_US.UTF-8') os.putenv('LC_ALL', 'en_US.UTF-8')