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 <luc@FontFabrik.com> 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

Wingo
  • 98
  • 7
  • Does this happen every time (abnormal), or was this the first time you imported pyplot (normal)? – user812786 Jul 26 '16 at 19:46
  • 2
    Possible duplicate of [matplotlib taking time when being imported](http://stackoverflow.com/questions/34771191/matplotlib-taking-time-when-being-imported) – user812786 Jul 26 '16 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. – Wingo Jul 28 '16 at 09:44

1 Answers1

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.

Community
  • 1
  • 1
Wingo
  • 98
  • 7