pygtk.require('2.0') error message not being displayed

I've been receiving the error message "matplotlib requires

    > pygtk-1.99.16 or greater -- trying anyway. Please hold on"
    > which is puzzling since I have pygtk 2.0 installed.

Is it possible you have both installed (eg, on a redhat 9 install the
default pygtk is 1.99.14) and that you are importing the wrong one

    > error message that pygtk.require('2.0') generates. I think
    > it would be improved by changing it to:

Good point. I changed it.

    > "pygtk.require() must be called before importing gtk
    > matplotlib requires pygtk-1.99.16 or greater -- trying
    > anyway. Please hold on"

This looks like you imported gtk in your app/script before either

  1) doing the pygtk.require thing
  2) importing matplotlib first

If you do either of these, does everything work fine for you?

JDH

    > I've been receiving the error message "matplotlib requires
    > pygtk-1.99.16 or greater -- trying anyway. Please hold on"
    > which is puzzling since I have pygtk 2.0 installed.

Is it possible you have both installed (eg, on a redhat 9 install the
default pygtk is 1.99.14) and that you are importing the wrong one

    > error message that pygtk.require('2.0') generates. I think
    > it would be improved by changing it to:

Good point. I changed it.

    > "pygtk.require() must be called before importing gtk
    > matplotlib requires pygtk-1.99.16 or greater -- trying
    > anyway. Please hold on"

This looks like you imported gtk in your app/script before either

  1) doing the pygtk.require thing
  2) importing matplotlib first

If you do either of these, does everything work fine for you?

I don't use pygtk.require() myself, since I'm just writing small
programs to run on my own system which has python 2.3.2 and pygtk 2.0
installed together.

The problem was in the import order
I was doing:
import gtk
import mylibrary # which imports matplotlib

and was getting the warning message. Changing to

import mylibrary
import gtk

stops the warning appearing.

Steve

···

On Mon, 2003-11-10 at 23:09, John Hunter wrote:

JDH

--
Steve Chaplin <stevech1097@...41...>