matplotlib trying to import _macosx in a ubuntu machine

Hi All,

I am using a Ubuntu 10.04 machine (Linux 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 i686 GNU/Linux)

And I am running Matplotlib version 0.99.1.1.

I got following errors when I am trying to run a program:

Traceback (most recent call last):
File “PS3_audionoise.py”, line 11, in
import matplotlib.pyplot as p
File “/usr/lib/pymodules/python2.6/matplotlib/pyplot.py”, line 78, in
new_figure_manager, draw_if_interactive, show = pylab_setup()
File “/usr/lib/pymodules/python2.6/matplotlib/backends/init.py”, line 25, in pylab_setup
globals(),locals(),[backend_name])
File “/usr/lib/pymodules/python2.6/matplotlib/backends/backend_macosx.py”, line 20, in
from matplotlib.backends import _macosx
ImportError: cannot import name _macosx

Seems the _macosx is for Mac, not Ubuntu.

I tried to install matplotlib both from source and using apt-get. But this error happens every time. Does any one know how to fix this?

Thanks!

This would only happen if the program explicitly calls for macosx backend with the use() function, or you have macosx backend selected in your .matplotlibrc file.

Ben Root

···

On Sunday, October 9, 2011, Shuo Deng <dengshuoamanda@…287…> wrote:

Hi All,

I am using a Ubuntu 10.04 machine (Linux 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 i686 GNU/Linux)

And I am running Matplotlib version 0.99.1.1.

I got following errors when I am trying to run a program:

Traceback (most recent call last):
File “PS3_audionoise.py”, line 11, in
import matplotlib.pyplot as p
File “/usr/lib/pymodules/python2.6/matplotlib/pyplot.py”, line 78, in
new_figure_manager, draw_if_interactive, show = pylab_setup()
File “/usr/lib/pymodules/python2.6/matplotlib/backends/init.py”, line 25, in pylab_setup
globals(),locals(),[backend_name])
File “/usr/lib/pymodules/python2.6/matplotlib/backends/backend_macosx.py”, line 20, in
from matplotlib.backends import _macosx
ImportError: cannot import name _macosx

Seems the _macosx is for Mac, not Ubuntu.

I tried to install matplotlib both from source and using apt-get. But this error happens every time. Does any one know how to fix this?

Thanks!