-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: font cache clearing should not need to be done for fresh install... #25306
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
Comments
My theory as to the underlying issue here is that we have shared state between venvs / conda envs (there is only one cache file in the users home directory). Thus if you:
In the new env we will now try to find the removed files and hence fail like the above. This story gets a bit worse if you are using the "venv in your working directory" model. One major issue with this explanation is that at least on my machine the fonts we ship are listed as relative paths in the json file on my computer. Not clear if this is a "editable install" thing, a linux thing, or a general thing yet.... One thing we need is a one-button "nuke the cache, try again". A second thing is that maybe we want to start scoping the cache files? I think that we need to use something like
All of the above can probably relpace |
See #10245. Didn't look in detail, but the relative paths should always be good as we haven't changed the list of vendored fonts since a very long time ago. Alternatively we could just special-case the vendored fonts and not include them into fontlist.json in any form but manually merge their entries into the FontManager object (in a sense that's probably the more robust solution wrt. the possibility that one day we may indeed change the vendored fonts). |
Bug summary
Somewhat a duplicate of #22281, but we should be doing something for users to rebuild the font cache if there is a failure in
findfont
.Code for reproduction
Actual outcome
Expected outcome
A figure with a \delta symbol for an xlabel.
Additional information
Works fine if I clear the font list from
~/.matplotlib
.Operating system
MacOS
Matplotlib Version
3.7.0
Matplotlib Backend
No response
Python version
3.11
Jupyter version
No response
Installation
conda
The text was updated successfully, but these errors were encountered: