1

When importing matplotlib:

from matplotlib import pyplot as plt

I get an User Warning:

~/.virtualenvs/cv/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.

And in addition I get about 50 lines of "Notice Copyright [c] 1994 Luc[as] de Groot <[email protected]> Published by TEndFontMetrics..."

Importing Matplotlib alone worked as expected and no warnings were shown. I'm using Matplotlib version 1.5.1 and Python 2.7.12 on Mac OS X El Capitan (10.11.3)

So far everything seems to work fine, but it takes extra time to import and the messages flood the terminal. What is the reason for this and is it possible to disable this behaviour?

UPDATE: I am using a virtual environment

3
  • Does this happen every time (abnormal), or was this the first time you imported pyplot (normal)? Commented Jul 26, 2016 at 19:46
  • 2
    Possible duplicate of matplotlib taking time when being imported Commented Jul 26, 2016 at 19:47
  • Yes, this happens every single time I try to from matplotlib import pyplot. However, no messages are displayed when I import matplotlib. In that sense, this scenario is different to the linked issue. Commented Jul 28, 2016 at 9:44

1 Answer 1

1

I deleted fontList.cache and tex.cach as advised on answer to the question linked by whrrgarbl. I addition, I created a file ~/.matplotlib/matplotlibrc and added line: backend: TkAgg as suggested here.

This solved the issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.