Ask Your Question

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

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

eod gravatar image

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

eric_g gravatar image


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/ 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:


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?


edit retag flag offensive close merge delete


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

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

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 +0200 )edit

1 Answer

Sort by » oldest newest most voted

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

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


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

eod gravatar imageeod ( 2020-02-19 13:14:44 +0200 )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


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

Seen: 7,082 times

Last updated: Jan 12 '20