我尝试过的内容:
请注意,我正在使用conda和Python 3.6,并且使用Mac OS X High-Sierra。
在发布之前,我阅读了以下问题/答案:
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
请注意,我正在使用conda和Python 3.6,并且使用Mac OS X High-Sierra。
在发布之前,我阅读了以下问题/答案:
- 在Mac OS X上安装pygtk的最简单方法
- Python Gtk3可执行文件
- https://github.com/neovim/python-gui/issues/33
- https://github.com/neovim/python-gui#dependencies-debian
- https://github.com/pybee/toga/issues/38
- 使用Python3和GTK3时出现“找不到任何Gtk typelib”的错误
- https://github.com/neovim/python-gui/issues/33
- 当获取版本时,pyGtk会出现缺少Gtk的错误
requires
更改为 2.0
,则它可以正常加载,但我会收到警告:“运行时警告:您已导入Gtk 2.0模块。由于Gtk 2.0不适用于内省使用,因此某些接口和API将失败。因此,这不受pygobject开发团队的支持,我们鼓励您将应用程序转换为Gtk 3或更高版本。 PyGTK是与Gtk 2.0一起使用的推荐python模块。”
)