linux ubuntu 报错findfont: Font family ‘Times New Roman‘ not found.
报错:
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Ti
解决办法:
1 在Windows系统里找到Times New Roman字体, 位置在C:\Windows\Fonts ,找到文件Times New Roman。
2 复制出来会变成三个文件,一块复制到你的linux中/usr/share/font文件夹下,如果没有自己创建文件夹。
3 运行下面代码查看matplotlib缓存位置:
python3 -c "import matplotlib; print(matplotlib.get_cachedir())"
输出:
 /home/alocus/.cache/matplotlib
进入该文件夹,删除fontlist-v330.json文件
4。 重新运行你的代码即可。
