美文网首页
unbantu 解决ubuntu中文字体显示为方块问题

unbantu 解决ubuntu中文字体显示为方块问题

作者: 阳光照我心房 | 来源:发表于2019-07-09 19:04 被阅读0次

解决ubuntu中文字体显示为方块问题

1. 拷贝字体文件

~/.virtualenvs/ai/local/lib/python3.5/site-packages/matplotlib/mpl-data/fonts/ttf

# 字体文件

# 打印matplotlib配置文件的位置

import matplotlib

print(matplotlib.matplotlib_fname())

2. 编辑配置文件

#cd  ~/.virtualenvs/ai/local/lib/python3.5/site-packages/matplotlib/mpl-data

#vim matplotlibrc

# 添加下面内容到配置文件中

font.family        : sans-serif

font.sans-serif        : SimHei

axes.unicode_minus  : False

3. 删除缓存文件

rm -r /.cache/matplotlib/*

4. 重新运行 jupyter notebook

相关文章

网友评论

      本文标题:unbantu 解决ubuntu中文字体显示为方块问题

      本文链接:https://www.haomeiwen.com/subject/aamfkctx.html