找不到字符集

终端报错:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

Jupyter notebook报错:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 0

解决方法:

locale-gen
dpkg-reconfigure locales
按提示选择字符集,一般是zh_CN.UTF-8

之后重启 jupyter 即可