cannot import gtk

Dave Reed dreed at capital.edu
Sun Nov 24 17:34:38 EST 2002


On Sunday 24 November 2002 15:59, Lenny wrote:
> Hi,
> 
> I've just installed a RH 8.0, and while trying to use python programs 
from
> my previous linuxbox, i encounter the following problems with python :
> 
> >    from gtk import GtkVBox
> >ImportError: cannot import name GtkVBox


The GTK prefix is removed:

try: 
from gtk import VBox


> this is just an example. I have the same errors with many widgets, but
> also, with GDK, etc.etc...
> 
> I tried with python (that is python1.5), python2 and python2.2


Red Hat 8.0 doesn't include python 1.5 (just python 2.2.1).


> I really have gtk+- installed (/usr/include/gtk-1.2 AND gtk-2.0)
> with (for the example above) a nice gtkvbox.h


Red Hat 8.0 comes with the libraries for gtk 1.2, but only the python
bindings for gtk 2.0. If you want to use python with gtk 1.2 you'll
have to install those bindings yourself.


> I think python does not know where to look for modules or something 
like
> that, but I'm new to this, and do not know what to do.

Nope, see above.

HTH,
Dave





More information about the Python-list mailing list