Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure removal of font cache on version upgrade #3655

Closed
ghost opened this issue Oct 17, 2014 · 6 comments
Closed

ensure removal of font cache on version upgrade #3655

ghost opened this issue Oct 17, 2014 · 6 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Oct 17, 2014

I just re-installed matplotlib on Linux VERSION="14.04.1 LTS, Trusty Tahr". Importing matplotlib suddendly became really slow, ~3 seconds. Reason being afm.py. (details at: http://stackoverflow.com/questions/26421364/extremely-slow-import-of-matplotlib-afm).

Matplotlib version is 1.4.0.

@jenshnielsen
Copy link
Member

I think this is related to the generation of font cache. This should normally only happen at the first import of matplotlib unless you delete 'fontList.cache' in your matplotlib configuration dir i.e. probably ~/.matplotlib

@tacaswell
Copy link
Member

I can't reproduce this, even if I delete my font cache.

@tacaswell tacaswell added this to the unassigned milestone Oct 17, 2014
@g2p
Copy link

g2p commented Nov 5, 2014

I had this problem, with time python -c 'import matplotlib.font_manager' taking at least five seconds. I had some broken .afm files and fontList.cache was never generated; I had to add a print statement to find which files were involved, because the files are all opened before any parsing begins.

@naskomit
Copy link

I had the same problem. I figured out, that this happens when you upgrade matplotlib to a newer version. The cache file is not compatible with the new version, but apparently is not recreated. Instead font list is created each time on the fly. The solution is to delete the matplotlib cache directory (in my case ~/.cache/matplotlib

@Zaharid
Copy link

Zaharid commented May 9, 2015

I can confirm this. I was able to resolve the problem by removing the matplotlib cache, as suggested here:

http://stackoverflow.com/questions/26421364/extremely-slow-import-of-matplotlib-afm

@wxgeo
Copy link

wxgeo commented Apr 28, 2016

Same issue for me (matplotlib 1.4.2 on Ubuntu 15.10), and removing matplotlib cache works well too.

rm -r ~/.cache/matplotlib/

Thanks for the tip, importing matplotlib was so painfully slow !

@tacaswell tacaswell modified the milestones: 2.0 (style change major release), unassigned Apr 29, 2016
@tacaswell tacaswell changed the title Slow import time of afm.py ensure removal of font cache on version upgrade Apr 29, 2016
@jenshnielsen jenshnielsen self-assigned this May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants