I'm using Debian 6.04 and Python 2.7
I compiled Python 2.7 ,(./configure,make,make install)
in the console:
>python2.7
Python 2.7.3 (default, Jul 28 2012, 16:54:06)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named gtk
How do I install gtk in Python 2.7?
In Python 2.6:
tiger@debian:~$ python
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
>>> import pygtk
>>> import gobject
GTK and Python It supports Linux, Windows and macOS and works with Python 2.7+, Python 3.5+, PyPy and PyPy3.
PIP is automatically installed with Python 2.7.9+ and Python 3.4+ and it comes with the virtualenv and pyvenv virtual environments. Before you install PIP on Windows, check if PIP is already installed.
(optional): If you want to develop a GTK3 application in Python, you need to install the Python bindings. If you develop in Python 3: pacman -S mingw-w64-x86_64-python3-gobject If you develop in Python 2: pacman -S mingw-w64-x86_64-python2-gobject Step 5. (optional): Install the build tools.
On Windows, GTK applications are typically bundled with GTK already, so end-users do not need to worry about how to install GTK itself. There are various methods to install GTK on Windows development machines. ... Install GTK3 and its dependencies. Open a MSYS2 shell, and run: pacman -S mingw-w64-x86_64-gtk3 Step 3.
It exclusively supports GTK+ version 3 or later. 1.1. Dependencies ¶ Python 2 (2.6 or later) or Python 3 (3.1 or later) 1.2. Prebuilt Packages ¶
: Install GTK3 and its dependencies. Open a MSYS2 shell, and run: pacman -S mingw-w64-x86_64-gtk3 Step 3. (recommended): Install the GTK core applications. Gladeis a GUI designer for GTK. It lets you design your GUI and export it in XML format. You can then import your GUI from your code using the GtkBuilder API.
Try installing it using pip/python-pip/easy_install. On Fedora I installed it like this:
sudo pip install PyGTK
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With