every blog every motto: You can do more than you think.
https://blog.csdn.net/weixin_39190382?type=blog
0. 前言
错误记录
findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei
1. 正文
1.1 问题
findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei
1.2 解决方法
- 删除缓存
import matplotlib as mpl
print(mpl.get_cachedir())
会输出类似如下地址,
/home/v/.cache/matplotlib
删除该地址中的文件
rm -r /home/v/.cache/matplotlib/*
- 下载字体
点击下载
放到~/.fonts目录下,若没有需创建一个
mkdir ~/.fonts
- 刷新
此步未执行,已成功
fc-cache -fv