Ask Your Question
1

"UserWarning: Matplotlib is building the font cache using fc-list." never resolves

asked 2020-01-12 16:40:25 +0100

eod gravatar image

updated 2020-01-12 17:58:58 +0100

eric_g gravatar image

Hi,

I just downloaded and installed Sage 9.0 on windows. Typing the following:

plot(x^3, (x,0,5))

Gives the following error:

/opt/sagemath-9.0/local/lib/python3.7/site-packages/matplotlib/font_manager.py:281: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
   'Matplotlib is building the font cache using fc-list. '

The kernel is running and nothing happens, even after waiting for a long time.

I did some googling. This stackexchange answer suggesting using

import matplotlib as mpl
print mpl.get_cachedir()

To get the directory of matplotlib, in order to (as suggested here) delete these files:

fontList.cache
fontList.py3k.cache 
tex.cache

I did this, the folder I got was: /home/sage/.sage/matplotlib-1.5.1

But this folder is empty (according to the Sage shell). There are no files to delete there.

Any suggestions for how to get plot to work?

Thanks.

edit retag flag offensive close merge delete

Comments

I downgraded to Sage 8.8 and now the plot command works as expected.

eod gravatar imageeod ( 2020-01-14 09:50:33 +0100 )edit
2

I experienced the same problem. I first tried to upgrade matplotlib by launching the sagemath shell running pip install --upgrade matplotlib. Then I use the following command to try the plotting function P = matrix_plot(matrix(2,[1,1,3,3])) and then P. If for the first time the console hangs at the message "Matplotlib is building the font cache using fc-list.", then press ctrl+c to break it and try the plot function again. Since I cannot replicate the problem now I am not sure if this is the solution to the problem. Good luck.

ray8_3 gravatar imageray8_3 ( 2020-01-16 12:02:36 +0100 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2020-02-07 11:29:00 +0100

I had the same problem. I did the following:

1- Upgrade matplotlib by launching the sagemath shell running pip install --upgrade matplotlib.

2- I installed matploplib in a different virtualenv. This created a folder called ~/.matplotlib.

3- I copied the content of ~/.matplotlib to /home/sage/.sage/matplotlib-1.5.1.

It solved the issue for me.

edit flag offensive delete link more

Comments

Thanks for answering. The latest version of Sage 9 is working for me now though.

eod gravatar imageeod ( 2020-02-19 13:14:44 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-01-12 16:40:25 +0100

Seen: 7,792 times

Last updated: Jan 12 '20