Using Wing with GTK and PyGObject

Index of All Documentation » How-Tos » How-Tos for GUI Development »

Wing is a Python IDE that can be used to develop, test, and debug Python code written for GTK using PyGObject. Two versions of Wing are appropriate for use with this document: Wing Pro is the full-featured Python IDE for professional programmers, and Wing Personal is a free alternative with reduced feature set.

If you do not already have Wing installed, download it now.

This document describes how to configure Wing for GTK and PyGObject. To get started using Wing as your Python IDE, please refer to the tutorial in Wing's Help menu or read the Quickstart Guide.


PyGObject uses lazy (on-demand) loading of functionality to speed up startup of applications that are based on it. This prevents Wing's analysis engine from inspecting PyGObject-wrapped APIs and thus the IDE fails to offer auto-completion.

To work around this, use Fakegir, which is a tool to build a fake Python package of PyGObject modules that can be added to the Source Analysis > Advanced > Interface File Path in preferences. The parent directory of the generated gi package should be added; if the defaults are used, the directory to add is ~/.cache/fakegir.

Fakegir's provides usage details.

Don't add the Fakedir produced package to the Python Path defined in Wing's Project Properties because code will not work if the fake module is actually on sys.path when importing any PyGObject-provided modules.

Once this is done Wing should offer auto-completion for all PyGObject-provided modules and should be able to execute and debug your code without disruption.

Related Documents

Wing provides many other options and tools. For more information: