What I tried:
brew install pygobject3 --with-python@2 gtk+3
brew install pygtk3
brew install pygobject3
pip install pygobject
python -c 'import gi; gi.require_version("Gtk", "3.0")'
Result:
ValueError: Namespace Gtk not available for version 3.0
Note that I'm running conda, with python 3.6; and Mac OS X High-Sierra
I read through the following questions/answers before posting:
- Easiest way to install pygtk on Mac OS X
- Python Gtk3 executable
- https://github.com/neovim/python-gui/issues/33
- https://github.com/neovim/python-gui#dependencies-debian
- https://github.com/pybee/toga/issues/38
- Error "Could not find any typelib for Gtk" with Python3 and GTK3
- https://github.com/neovim/python-gui/issues/33
- pyGtk: Gtk missing error when get version
(Note that if I change the requires
to 2.0
, then it loads ok, but I get a warning:
"RuntimeWarning: You have imported the Gtk 2.0 module. Because Gtk 2.0 was not designed for use with introspection some of the interfaces and API will fail. As such this is not supported by the pygobject development team and we encourage you to port your app to Gtk 3 or greater. PyGTK is the recomended python module to use with Gtk 2.0" )