matplotlib taking time when being imported

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

From: stackoverflow.com/q/34771191

Back to homepage or read more recommendations: