Error on matplotlib with the hist() method [ archlinux ]

Hello, Im running the last matplotlib version.

I just want to plot an histogram. Here is the complete backtrace, complaining
about the Vera.ttf font missing :

Any idea ?

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py",
line 393, in expose_event
    self._render_figure(self._pixmap, w, h)
  File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_gtkagg.py",
line 75, in _render_figure
    FigureCanvasAgg.draw(self)
  File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py",
line 394, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in
draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/matplotlib/figure.py", line 798, in draw
    func(*args)
  File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in
draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/matplotlib/axes.py", line 1934, in draw
    a.draw(renderer)
  File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in
draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/matplotlib/axis.py", line 1017, in draw
    tick.draw(renderer)
  File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in
draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/matplotlib/axis.py", line 234, in draw
    self.label1.draw(renderer)
  File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in
draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/matplotlib/text.py", line 524, in draw
    bbox, info = self._get_layout(renderer)
  File "/usr/lib/python2.7/site-packages/matplotlib/text.py", line 298, in
_get_layout
    ismath=False)
  File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py",
line 180, in get_text_width_height_descent
    font = self._get_agg_font(prop)
  File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py",
line 221, in _get_agg_font
    font = FT2Font(str(fname))
RuntimeError: Could not open facefile /usr/lib/python2.6/site-
packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf; Cannot_Open_Resource

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py",
line 393, in expose_event
    self._render_figure(self._pixmap, w, h)
  File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_gtkagg.py",
line 75, in _render_figure
    FigureCanvasAgg.draw(self)
  File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py",
line 394, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in
draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/matplotlib/figure.py", line 798, in draw
    func(*args)
  File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in
draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/matplotlib/axes.py", line 1934, in draw
    a.draw(renderer)
  File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in
draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/matplotlib/axis.py", line 1017, in draw
    tick.draw(renderer)
  File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in
draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/matplotlib/axis.py", line 234, in draw
    self.label1.draw(renderer)
  File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in
draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/matplotlib/text.py", line 524, in draw
    bbox, info = self._get_layout(renderer)
  File "/usr/lib/python2.7/site-packages/matplotlib/text.py", line 298, in
_get_layout
    ismath=False)
  File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py",
line 180, in get_text_width_height_descent
    font = self._get_agg_font(prop)
  File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py",
line 221, in _get_agg_font
    font = FT2Font(str(fname))
RuntimeError: Could not open facefile /usr/lib/python2.6/site-
packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf; Cannot_Open_Resource

File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py",

python 2.7 ^^

RuntimeError: Could not open facefile /usr/lib/python2.6/site-
packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf; Cannot_Open_Resource

python 2.6 ^^

I believe this problem is fixed in the next matplotlib release. A workaround is to remove a local font cache file:

rm ~/.matplotlib/fontList.cache

HTH,
daryl

···

On Sun, 31 Oct 2010, David Kremer wrote:

It worked. Thank you.

I also did a symbolic link, but your method worked, so I deleted it.

Thank you.

David

···

On Sun, 31 Oct 2010, David Kremer wrote:
> File
> "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py",

python 2.7 ^^

> RuntimeError: Could not open facefile /usr/lib/python2.6/site-
> packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf; Cannot_Open_Resource

python 2.6 ^^

I believe this problem is fixed in the next matplotlib release. A
workaround is to remove a local font cache file:

rm ~/.matplotlib/fontList.cache

HTH,
daryl