原始环境变量
- /> python
- Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:09:58)
- [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on Linux
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import sys
- >>> sys.stdout.encoding
- 'GBK'
- >>> exit()
修改变量 PYTHONIOENCODING
- export PYTHONIOENCODING=utf-8
- > python
- Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:09:58)
- [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on Linux
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import sys
- >>> sys.stdout.encoding
- 'utf-8'
- >>> exit()
来源: http://www.bubuko.com/infodetail-2950005.html