When following the instructions 2. Getting Started — Python GTK+ 3 Tutorial 3.4 documentation
Tries
In [6]: import gi
...: gi.require_version('Gtk', '3.0')
...: from gi.repository import Gtk
it report errors:
~/anaconda3/lib/python3.7/site-packages/gi/__init__.py in require_version(namespace, version)
128 available_versions = repository.enumerate_versions(namespace)
129 if not available_versions:
--> 130 raise ValueError('Namespace %s not available' % namespace)
131
132 if version not in available_versions:
ValueError: Namespace Gtk not available
Follow How do I Install GTK+ 3.0? - Ask Ubuntu and intstalled Gtk to ubuntu
sudo apt-get install libgtk-3-dev
However, it still report the same errors.
How could solve the problem?
which python3
to know which python3 you used. System python3, which containsgi
andGtk
, is located in/usr/bin/python3
.dpkg -l | grep libgtk3
anddpkg -l | grep libgtk-3
.