Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
27
rated 0 times [  27] [ 0]  / answers: 1 / hits: 20030  / 1 Year ago, thu, january 12, 2023, 5:12:20

I have installed Eclipse + PyDev + Python 3.2. Now I have two Python interpreters in PyDev: Python 2.7 and Python 3.2. If I try to execute command import pygtk with 2.7 interpreter it works fine, but with Python 3.2 it raises ImportError: No module named pygtk.



How can I get PyGTK to work with Python 3.2?


More From » python

 Answers
7

PyGTK has been deprecated in favor of PyGI+GTK. Because of that, a version of PyGTK for Python 3 was never written.



To use PyGI+GTK in Python 3, you need to install the python3-gobject package and do



from gi.repository import Gtk



For a quick introduction on porting PyGTK code to PyGI+GTK, see here:



https://live.gnome.org/PyGObject/IntrospectionPorting



For a full tutorial, see here:



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


[#40849] Friday, January 13, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
suspengn

Total Points: 477
Total Questions: 104
Total Answers: 100

Location: Rwanda
Member since Thu, Feb 10, 2022
2 Years ago
;