【发布时间】:2018-04-21 14:51:24
【问题描述】:
我尝试了什么:
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")'
结果:
ValueError: Namespace Gtk not available for version 3.0
请注意,我正在使用 python 3.6 运行 conda;和 Mac OS X High-Sierra
我在发帖前阅读了以下问题/答案:
- 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
(请注意,如果我将requires 更改为2.0,则加载正常,但我收到警告:
"RuntimeWarning: 你已经导入了 Gtk 2.0 模块。因为 Gtk 2.0 不是为使用自省而设计的,所以一些接口和 API 会失败。因此,pygobject 开发团队不支持,我们鼓励你移植您的应用程序升级到 Gtk 3 或更高版本。PyGTK 是与 Gtk 2.0 一起使用的推荐 python 模块" )
【问题讨论】:
标签: python pip pygtk macos-sierra