You are not logged in.

#1 2011-10-20 22:20:52

puntigamer
Member
Registered: 2011-10-20
Posts: 5

Import GTK3 to Python3

Hi folks,

I would like to make some UI-s for some of my homework programs in Python3, and I would like to use GTK3 to make it.
Everything seems to be right installed, but I still can't import GTK3. With Python2 it is ok.
I get the following message:

Traceback (most recent call last):
  File "visual.py", line 2, in <module>
    from gi.repository import Gtk
ImportError: No module named gi.repository

Do you have any ideas?
Thank you

Offline

#2 2011-10-21 04:07:03

kyla
Member
From: Arlington, VA
Registered: 2011-03-12
Posts: 112
Website

Re: Import GTK3 to Python3

Which packages for it have you installed? The gtk stuff works fine for me, and these are the packages I have that I think are related: gobject-introspection, python-gobject, python-gobject2, pygobject-devel, pygobject2-devel. These are python3 packages, so obviously you'd want the python2 versions if that's what you're using.

EDIT: D'oh. gtk3 should probably be in that list as well.

Last edited by kyla (2011-10-21 04:07:54)

Offline

#3 2011-10-21 05:05:55

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: Import GTK3 to Python3

you need python-gobject.

the old python-gobject2 doesn't contain gboject-introspection support anymore


Give what you have. To someone, it may be better than you dare to think.

Offline

#4 2011-10-21 18:43:41

puntigamer
Member
Registered: 2011-10-20
Posts: 5

Re: Import GTK3 to Python3

Thank you very much, I missed only the python-gobject packet smile
Now I download a manual and have some fun!

Offline

#5 2011-10-22 14:43:33

puntigamer
Member
Registered: 2011-10-20
Posts: 5

Re: Import GTK3 to Python3

By the way, does anyone know any "hands-on" GTK3/Python3 manual? smile

Offline

#6 2011-10-22 18:26:28

kyla
Member
From: Arlington, VA
Registered: 2011-03-12
Posts: 112
Website

Re: Import GTK3 to Python3

I haven't messed around with it very much, but this is the only tutorial I've looked at so far, dunno how 'hands on' it really is though.

http://python-gtk-3-tutorial.readthedocs.org/en/latest/

Offline

Board footer

Powered by FluxBB