我刚刚升级到 matplotlib
(1.5.1) 的最新稳定版本,每次导入 matplotlib 时都会收到以下消息:
/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
...总是停顿几秒钟。
这是预期的行为吗?之前是不是也一样,只是没有打印出来的信息?
最佳答案
正如汤姆在上面的评论中建议的那样,删除文件:
fontList.cache
fontList.py3k.cache
tex.cache
解决问题。 就我而言,文件位于:
`~/.matplotlib`
已编辑
几天前消息再次出现,我删除了上述位置的文件,但没有成功。我发现正如建议 here由 T Mudau文本缓存文件的额外位置是:~/.cache/fontconfig
关于python - matplotlib 导入时需要时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34771191/