0

I have been facing a couple of issues in using matplotlib with Python 3. After getting rid of this one, I ran into a new one. When I tried to execute the histogram demo, I get this traceback.

Does anyone have an idea? My matplotlib version is: python3-matplotlib-1.2.0-8.fc18.x86_64 (i.e. 1.2 on Fedora 18).

Bugs filed:

  1. Fedora
  2. Matplotlib
3
  • @eryksun It says: font_manager attribute not found o_O. Commented Mar 30, 2013 at 10:41
  • Okay, my bad. It reports True. Commented Mar 30, 2013 at 10:48
  • Thanks @eryksun. I went ahead and set it to False in /usr/lib/* itself. And it worked. You reckon I should report this as a bug upstream? Commented Mar 30, 2013 at 10:57

1 Answer 1

2

Add this to the top of the histogram_demo.py, just before import numpy:

from matplotlib import font_manager
font_manager.USE_FONTCONFIG = False

Or modify font_manager.py to change the value permanently.

As far as bug reports go, I'd report the USE_FONTCONFIG = True setting to the Fedora package manager. The subprocess output decoding issue (or regex pattern issue) in Python 3.x should be reported upstream to the matplotlib project.

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

2 Comments

Adding the two lines in the histogram_demo.py file doesn't work, because USE_FONTCONFIG is set to True in font_manager.py, when its imported by backend_agg.py. Thanks for all your help.
@Amit: Sorry, I guess you're right. I only use matplotlib in 2.x. When I do import matplotlib it doesn't load the font_manager module. I have to import matplotlib.pyplot for that to happen.

Your Answer

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