-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
import pyplot on MacOS without font cache will search entire subtree of current dir #12176
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
As I said elsewhere, I think my initial reaction to this was wrong and that rather than fixing a bug, adding the While including the cwd makes sense at first glance, it does not because a) the result is cached so the next time your cwd will be different but we will not find those files b) the time it takes to search all the files as reported here c) the other 2 platforms do not do this. Given that the initial change change came in over 7 years ago I am willing to accept that the original reasons are lost to time and restore the previous behavior. For now for people on macs the best work around is to make an empty directory, cd there and import matplotlib (to get the cache to build side stepping reading your whole file system). The next time you import matplotlib it should find the cache file and not try to re-build it. |
While including the cwd makes sense at first glance, it does not because a) the result is cached so the next time your cwd will be different but we will not find those files b) the time it takes to search all the files is causing prolems c) the other 2 platforms do not do this The comma was introduced to fix what looked like a bug (implicit string concatenation instead of adding the empty string to the list) in matplotlib#11963. Original code come in via 4799341 in 2011. closes matplotlib#12176
While including the cwd makes sense at first glance, it does not because a) the result is cached so the next time your cwd will be different but we will not find those files b) the time it takes to search all the files is causing prolems c) the other 2 platforms do not do this The comma was introduced to fix what looked like a bug (implicit string concatenation instead of adding the empty string to the list) in matplotlib#11963. Original code come in via 4799341 in 2011. closes matplotlib#12176
I am experiencing this bug in a Jupyter notebook I'm using for a university course and doing the exact steps you mentioned (cd to new directory, open Python 3, Can you provide a detailed way to generate the missing file so that importing matplotlib.pyplot no longer crashes? Thank you. |
@Sparen, This should not cause a crash; the issue above was a long hang.... If it does cause a crash, please open a new issue with full details. Please try and take jupyter out of the equation if possible (try with a pure python shell) Thanks |
Running the import directly in the Python 3 shell with the commands I ran above causes a crash. I will open a new issue. |
Bug report
Bug summary
On import if
/Users/lloyd/.matplotlib/fontlist-v300.json
does not exist, will scan entire tree of current dir.Looks like this was a typo, and then a flake commit included "" which pathlib interperetes as .
https://github.com/matplotlib/matplotlib/pull/11963/files#r218979454
Code for reproduction
On a mac installed with conda if
~/.matplotlib/fontlist-v300.json
doesn't existTakes minutes.... ctl-c
Matplotlib version
The text was updated successfully, but these errors were encountered: