Ask Your Question
1

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

asked 5 years ago

eod gravatar image

updated 5 years ago

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.

Preview: (hide)

Comments

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

eod gravatar imageeod ( 5 years ago )
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 ( 5 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 5 years ago

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.

Preview: (hide)
link

Comments

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

eod gravatar imageeod ( 5 years ago )

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: 5 years ago

Seen: 8,473 times

Last updated: Jan 12 '20