原始环境变量

/> 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()

 

相关文章:

  • 2022-12-23
  • 2021-09-07
  • 2021-12-05
  • 2021-07-25
  • 2021-04-16
  • 2021-12-01
猜你喜欢
  • 2021-07-15
  • 2021-07-24
  • 2021-12-25
  • 2022-02-09
  • 2021-12-05
  • 2022-12-23
相关资源
相似解决方案