ImportError: No module named _backend_gdk

Hi,

I'm using the GTKAgg backend and when I run "import matplotlib.pyplot as
plt" in the Python shell, I get the _backend_gdk error. I checked all the
files in my backend and there is no _backend_gdk.py. In fact, there are no
python modules that start with an underscore. It seems that some files were
not installed. Is there some kind of a gtk dependancy I need to install
before installing matplotlib? If so, where can I get it? My matplot version
is 1.3.1.

thanks

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/ImportError-No-module-named-backend-gdk-tp43753.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

discolemonade, on 2014-08-05 21:29, wrote:

Hi,

I'm using the GTKAgg backend and when I run "import matplotlib.pyplot as
plt" in the Python shell, I get the _backend_gdk error. I checked all the
files in my backend and there is no _backend_gdk.py. In fact, there are no
python modules that start with an underscore.

As a rule of thumb, modules that start with an underscore come
from a compiled C or C++ extension. In this case, the source
file in question lives in src/_backend_gdk.c of the matplotlib
directory.

It seems that some files were not installed. Is there some kind
of a gtk dependancy I need to install before installing
matplotlib? If so, where can I get it? My matplot version is
1.3.1.

Yes, you'll need GTK and its headers installed, something like

  sudo apt-get install libgtk2.0-dev python-gtk2-dev

should work on a Debian system, though you should probably just

  sudo apt-get build-dep python-matplotlib

best,

···

--
                   _
                  / \
                A* \^ -
             ,./ _.`\\ / \
            / ,--.S \/ \
           / `"~,_ \ \
     __o ?
   _ \<,_ /:\
--(_)/-(_)----.../ | \
--------------.......J
Paul Ivanov
ipython and matplotlib core developer
http://pirsquared.org

Thanks Paul. I'm new to all of this and the interplay between GTK, it's
headers and matplotlib is admittedly still a bit of a mystery to me. I have
GTK installed. I installed it after installing matplotlib because I tried to
use TKAgg as a backend and ended up running into some problems. I'm on
MacOSX Mavericks. I've been googling around and there don't seem to be any
direct answers for how to gett these headers installed on Mac OS. What's the
quickest way to get these headers on my system(via homebrew?)? And once I
get them, do I have to reinstall matplotlib so that it can recognize the
headers?

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/ImportError-No-module-named-backend-gdk-tp43753p43761.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I recommend MacPorts [1] to install open source packages on Mac, including matplotlib.
-Sterling
[1] http://www.macports.org/

···

On Aug 6, 2014, at 8:15PM, discolemonade wrote:

Thanks Paul. I'm new to all of this and the interplay between GTK, it's
headers and matplotlib is admittedly still a bit of a mystery to me. I have
GTK installed. I installed it after installing matplotlib because I tried to
use TKAgg as a backend and ended up running into some problems. I'm on
MacOSX Mavericks. I've been googling around and there don't seem to be any
direct answers for how to gett these headers installed on Mac OS. What's the
quickest way to get these headers on my system(via homebrew?)? And once I
get them, do I have to reinstall matplotlib so that it can recognize the
headers?

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/ImportError-No-module-named-backend-gdk-tp43753p43761.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hi,

Thanks Paul. I'm new to all of this and the interplay between GTK, it's
headers and matplotlib is admittedly still a bit of a mystery to me. I have
GTK installed. I installed it after installing matplotlib because I tried to
use TKAgg as a backend and ended up running into some problems.

As a matter of interest - what problem did you have? How did you
install matplotlib?

I'm on
MacOSX Mavericks. I've been googling around and there don't seem to be any
direct answers for how to gett these headers installed on Mac OS. What's the
quickest way to get these headers on my system(via homebrew?)?

Does 'brew install gtk+' work for that?

And once I
get them, do I have to reinstall matplotlib so that it can recognize the
headers?

I'm afraid so. If I were you, I'd check out the source for that, as in:

git clone git://github.com/matplotlib/matplotlib.git
cd matplotlib
git checkout v1.3.1
python setup.py install

Feel free to post again if that doesn't work.

Cheers,

Matthew

···

On Wed, Aug 6, 2014 at 8:15 PM, discolemonade <schillermika@...287...> wrote: