问题
findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei
解决方法
import matplotlib
print(matplotlib.matplotlib_fname())
输出:xxx/lib/python3.7/site-packages/matplotlib/mpl-data/matplotlibrc
下载 http://129.204.205.246/downloads/SimHei.ttf
复制到 xxx/lib/python3.7/site-packages/matplotlib/mpl-data/fonts/ttf
python字体缓存文件
import matplotlib
print(matplotlib.get_cachedir())
rm -rf 输出的地址/*
标签:中文,lib,site,matplotlib,乱码,print,ttf From: https://www.cnblogs.com/jsxzhub/p/17767234.html