python - matplotlib 导入时需要时间

标签 python matplotlib

我刚刚升级到 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`

已编辑

几天前消息再次出现,我删除了上述位置的文件,但没有成功。我发现正如建议 hereT Mudau文本缓存文件的额外位置是:~/.cache/fontconfig

关于python - matplotlib 导入时需要时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34771191/

相关文章:

python - 数学文本解析器 : Fit output to figsize

python - 根据阈值将 NumPy 数组转换为 0 或 1

python - Matplotlib png 输出在 reportlab 的 pdf 中出现 "broken"

python - 如何在图形/绘图(在 matplotlib 中)上显示对象的值?

pandas - 每行 Pandas 的多个饼图

python - 在 Matplotlib 中保持绘图窗口打开

python - 在图中移动图形位置 (matplotlib)

python - 是否可以从 PyQt5 的线程中获取数组?

python - 没有运算符匹配给定的名称和参数类型。 - Django F() 表达式

python - 如何在 Python 的 Tkinter 中获取多个 Checkbutton 的文本值列表?