[英]gi.repository Windows
I'm developing an app which has to be 100% compatible on windows and on linux. 我正在开发一个必须在Windows和Linux上100%兼容的应用程序。 On linux I have no problems, but on windows I came up with this message: from gi.repository import Gtk ImportError: No module named gi 在linux上,我没有问题,但是在Windows上,我想到了以下消息:从gi.repository import Gtk ImportError:没有名为gi的模块
I installed pygobject, pygtkallinone, gtk.. what am I missing? 我安装了pygobject,pygtkallinone,gtk ..我缺少什么?
Most of Havok answer is correct, except that documentation has been improved a lot lately, with a Tutorial: 大多数Havok答案都是正确的,除了最近的文档使用Tutorial改进了很多:
Including a PDF version for offline reading: 包括PDF版本以供离线阅读:
And a complete API reference manual, not only of Gtk but also many other libraries that you can use with introspection: 以及完整的API参考手册,不仅是Gtk的手册,还包括可用于自省的许多其他库:
on windows the support is great, a lot of effort has been put in creating all the windows executables and libraries, the last release of pygi-aio is 3.10.6: 在Windows上,它的支持很棒,在创建所有Windows可执行文件和库上已经付出了很多努力,pygi-aio的最新版本是3.10.6:
I've also put instructions on the Gnome wiki on how to build on win32 with pygobject introspection, it's not that hard, I've also uploaded a setup.py that actually works: 我还在Gnome Wiki上发布了有关如何使用pygobject自省在win32上进行构建的说明,这并不难,我还上传了一个有效的setup.py:
So the answer is, don't go with PyGTK 所以答案是,不要与PyGTK一起使用
gi.repository
module is called PyGObject and is for Gtk+3 and is not yet available for Windows (there has been experiments, but is not ready AFAIK). gi.repository
模块称为PyGObject ,适用于Gtk + 3,尚不适用于Windows(已进行实验,但尚未准备好AFAIK)。 https://live.gnome.org/PyGObject https://live.gnome.org/PyGObject
gtk
module is called PyGtk and is for Gtk+2 and is very mature on Windows platforms (in particular 2.24). gtk
模块称为PyGtk ,用于Gtk + 2,在Windows平台(特别是2.24)上非常成熟。 http://www.pygtk.org/ http://www.pygtk.org/
What's the difference? 有什么不同?
If you choose to go PyGtk there is great support for freezing the application. 如果您选择使用PyGtk,则可以冻结应用程序。 You can check my documentation and support files for my application here: http://sourceforge.net/p/nestededitor/code/247/tree/trunk/dist/windows/ 您可以在这里查看我的应用程序的文档和支持文件: http : //sourceforge.net/p/nestededitor/code/247/tree/trunk/dist/windows/
Hope it helps. 希望能帮助到你。
EDIT: 编辑:
Many things have changed in two years. 两年来,许多事情发生了变化。 Please see gianmt answer. 请参阅gianmt答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.