Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed matplotlib 1.1 from source, but I cant get any plot to show. python build shows the following:

            matplotlib: 1.1.0
                python: 2.7.2+ (default, Oct  4 2011, 20:06:09)  [GCC 4.6.1]
              platform: linux2

                 numpy: 1.5.1
             freetype2: 12.2.6

                libpng: 1.2.46
               Tkinter: no
                        * Using default library and include directories for
                        * Tcl and Tk because a Tk window failed to open.
                        * You may need to define DISPLAY for Tk to work so
                        * that setup can determine where your libraries are
                        * located. Tkinter present, but header files are not
                        * found. You may need to install development
                        * packages.

( Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

( Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

( Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

( Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
            pkg-config: looking for pygtk-2.0 gtk+-2.0
                        * Package pygtk-2.0 was not found in the pkg-config
                        * search path. Perhaps you should add the directory
                        * containing `pygtk-2.0.pc' to the PKG_CONFIG_PATH
                        * environment variable No package 'pygtk-2.0' found
                        * You may need to install 'dev' package(s) to
                        * provide header files.
                  Gtk+: no
                        * Could not find Gtk+ headers in any of
                        * '/usr/local/include', '/usr/include', '.'
       Mac OS X native: no
                    Qt: no
                   Qt4: no
                 Cairo: 1.8.8

              datetime: present, version unknown
              dateutil: 1.4.1
                  pytz: 2011c

                dvipng: no
           ghostscript: 9.04
                 latex: no
               pdftops: 0.16.7

But I think I already have tkinter and gtk libraries. Any help ?

share|improve this question

migrated from Apr 23 '12 at 13:21

This question came from our site for professional and enthusiast programmers.

You mean asking it there? – vivek Apr 20 '12 at 7:07
Yep :) It's part of the stackexchange-network, so you can simply login with your SO-credentials there. The guys there love questions about Ubuntu :) – Quasdunk Apr 20 '12 at 7:08
@Quasdunk, I've flagged it and asked it to be moved. If that doesn't work, I'll post it there too. thanx – vivek Apr 20 '12 at 7:13
I'm sure you'll get help there quickly :) Goo luck! – Quasdunk Apr 20 '12 at 7:19
The output shows you have no dependecies required for plotting, no tk, no gtk. To get this on Ubuntu do: aptitude build-dep python-matplotlib (You should remove the old installation, and recompile again, see a convinient way here:…) – Oz123 Apr 23 '12 at 6:46
up vote 3 down vote accepted

To elaborate on Oz123's comment, apt-get build-dep foo (or aptitude) allows you to pull all packages needed to build foo from the repositories. Thus, to install the necessary build dependencies for matplotlib, run apt-get build-dep matplotlib

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.