How to Install PyGTK in Python on Windows?
Last Updated :
29 Oct, 2021
PyGTK is a Python package or module that enables developers to work with GTK+ GUI Toolkit. This is how WikiBooks describes GTK+:
“GTK+ is a highly usable, feature rich toolkit for creating graphical user interfaces which boasts cross platform compatibility and an easy to use API.”
And this is how gtk.org the official website of GTK markets it:
Offering a complete set of UI elements, GTK is suitable for projects ranging from small one-off tools to complete application suites.
Although Python comes with a built-in module called Tkinter which is used to make simple GUI applications. But many developers are unsatisfied by the appearance of the application made by it and it is not even feature-rich so as to help in making elaborate software. Therefore GTK+ in association with Python is considered to be a great alternative to Tkinter. Although GTK library supports many programming languages such as C, JavaScript, Perl, Rust and Vala. But it is most widely used in association with Python which employs a language wrapper to fully utilize the capabilities of the official GNOME binding to produce the most stable applications.
GTK library comes jam-packed with features that enable developers to do whatever they want. Here are some of the main selling points of GTK.
- Portability
- Stability
- Language Binging
- Interfaces
- OpenSource
- API
- Accommodation
- Foundations
Listing some of the famous applications which are made by this GTK are as follows:
- GIMP
- Transmission
- Evolution
- Polati
- Games of all sorts
- Etc.
Below we will go through all the steps to install PyGTK in the windows operating system in detail.
Prerequisite: Install Python interpreter.
If you don’t already have Python installed on your Windows system then follow this tutorial.

Step 1: Install MSYS2
The first step in order to install PyGTK in our system is to install MSYS2. MSYS2 is a set of libraries that makes it easy to install and work with native programs in Windows. To put it simply it is a command-line tool similar to what we get in Linux-based operating systems. This command-line tool is called Minty. It uses bash and is somewhat similar to Git version control system. Developers who have used Linux-based operating systems for development would very well understand the powers that this feature-packed toll brings to developers. It comes with a package manager of its own called Pacman. Some of its simple use cases are the complete upgrades of systems and packages.
To install this application we first need to visit the msys2.org . There on the home page itself, there is an installation guide and in the first step, one can find the button to download the 64-bit executable file of MSYS2.

After the download is complete the installer will be launched on double-click. There is nothing much to the installation process, only the destination folder is to be selected. But it is recommended you leave it as it is.

And when the installation process is finished remember to check the run option at the last window and click finish button.

Now we must be having a terminal window open after clicking on the finish button. This means the installation process was completed successfully.
You can also add the installation location of the MSYS2 in the Environment Variables so as to access it from anywhere in your system.
Step 2: Update System
Now what needs to be done is to issue two commands which will upgrade our system and all the existing packages to prevent a breakdown in the future. The first thing to do is to visit the installation location of MSYS2 in the C drive and open the mys2 application.

So the first command to be issued in the command line tool is as follows:
pacman -Syy
The above command will not take more than a minute to complete on a decent internet speed. And the second command is as follows:
pacman -Syuu
The above command will ask for confirmation, which can be given by pressing the y key.

Step 3: install GTK3
Now that the system is up to date we can proceed with the install of the GTK3 library. And for that, we need to run a command in the same terminal window as in the previous step.

pacman -S mingw-w64-x86_64-gtk3
Once this command is completely executed it will signify that all the main stuff for our endeavour is ready. Now only a few tweaks are needed which will be done in the coming steps.
Step 4: Install Glad
Glad is a tool which whose main function is to act as the GUI designer for GTK3. To install this tool we need to run the below command:
pacman -S mingw-w64-x86_64-glade
Step 5: Install Python Binding
Since our main motive is to work with GTK3 along with Python we also need to download one last tool or library that will bridge the gap between the Python script and GTK3 commands. The tool that is needed here is Python binding. Depending on whether you have python 2 or python 3 installed on your system you can run the suitable command.
Python 3:
pacman -S mingw-w64-x86_64-python3-gobject
Python 2:
pacman -S mingw-w64-x86_64-python2-gobject
So this completed all the steps that are there for the installation of PyGTK in a Windows system.
Similar Reads
How to Install Pyglet in python on Windows?
The pyglet library is a cross-platform windowing and multimedia library for Python, intended for developing games and other visually rich applications. In this article, we will look into the process of installing Pyglet in Python on Windows. Pre-requisites: The only thing that you need for installin
2 min read
How to Install openpyxl in python on windows
It is common for data frames to be stored in excel files or as .csv files. Therefore, it is required for most programming languages to be equipped with utilities that allow the user to process such files. Openpyxl is a Python library for reading and writing Excel files with extensions like xlsx, xls
2 min read
How to install Python on Windows?
Python is a high-level programming language that has become increasingly popular due to its simplicity, versatility, and extensive range of applications. The process of How to install Python in Windows, operating system is relatively easy and involves a few uncomplicated steps. This article aims to
5 min read
How to Install PyQt for Python in Windows?
In this article, we will be looking at the stepwise procedure to install the PyQt for python in Windows. PyQt is a Python binding of the cross-platform GUI toolkit Qt, implemented as a Python plug-in. PyQt is free software developed by the British firm Riverbank Computing. Features of PyQt: There ar
2 min read
How to Install Eli5 in Python on Windows?
Eli5 is an open-source and cross-platform Python library available for various operating systems including Windows, Linux, and macOS, written to easily and quickly debug machine learning classifier models to explain their predictions. It provides support for machine learning frameworks and packages
2 min read
How to Install Gekko In Python on Windows?
In this article, we will learn how to install Gekko in Python on Windows . GEKKO is a Python package for machine learning and optimization of mixed-integer and differential-algebraic equations. It is coupled with large-scale solvers for linear, quadratic, nonlinear, and mixed-integer programming (LP
2 min read
How to Install Scipy in Python on Windows?
Scipy is a python library that is useful in solving many mathematical equations and algorithms. It is designed on the top of Numpy library that gives more extension of finding scientific mathematical formulae like Matrix Rank, Inverse, polynomial equations, LU Decomposition, etc. Using its high-leve
2 min read
How to Install Nose 2 in Python on Windows?
Nose 2 is a successor of Nose package and is used for testing python applications. In this article, we will look into the process of installing Nose2 Package on Windows. Pre-requisites: The only thing that you need for installing the Scrapy module on Windows are: Python PIP or Conda (depending upon
2 min read
How to Install Python Pyscreenshot on Windows?
PyScreenshot is a Python module and built since the PIL ImageGrab module only supported Windows, although Pillow now supports Linux and macOS as well. Flexible backends, Wayland compatibility, occasionally superior performance, and optional sub-processing are some of the main features of PyScreensho
2 min read
How to Install Fabric in Python on Windows?
Fabric is a Python library used to execute shell commands remotely over SSH, yielding useful Python objects in return.. In this article, we will look into the process of installing the Fabric Library on Windows. Pre-requisites: The only thing that you need for installing the Scrapy module on Windows
2 min read