matplotlib导入时需要时间 [英] matplotlib taking time when being imported
问题描述
我刚刚升级到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`
已编辑
几天前,该消息再次出现,我删除了上述位置中的文件,但没有成功.我发现这是建议的 T Mudau中在此处,文本缓存文件还有一个额外的位置:~/.cache/fontconfig
>
I just upgraded to the latest stable release of matplotlib
(1.5.1) and everytime I import matplotlib I get this message:
/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.')
... which always stalls for a few seconds.
Is this the expected behaviour? Was it the same also before, but just without the printed message?
As tom suggested in the comment above, deleting the files:
fontList.cache
fontList.py3k.cache
tex.cache
solve the problem. In my case the files were under:
`~/.matplotlib`
EDITED
A couple of days ago the message appeared again, I deleted the files in the locations mention above without any success. I found that as suggested here by T Mudau there's an extra location with text cache files is: ~/.cache/fontconfig
这篇关于matplotlib导入时需要时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!