相关疑难解决方法(0)

用py2exe捆绑GTK3 +

平台是Windows 7 64位使用python 2.7和GTK3 +从http://sourceforge.net/projects/pygobjectwin32/files/?source=navbar安装

由于这个原因,exe被编译但无法运行

The following modules appear to be missing
['gi.repository.Gdk', 'gi.repository.Gtk', 'overrides.registry']
Run Code Online (Sandbox Code Playgroud)

我怎样才能正确包含这些文件?

在我的.py文件中导入

from gi.repository import Gtk, Gdk
Run Code Online (Sandbox Code Playgroud)

我的安装文件

#!/usr/bin/env python
from distutils.core import setup
import py2exe, sys
sys.path.append("C:\Python27\Lib\site-packages\gnome")
sys.path.append("C:\Python27\Lib\site-packages\repository")#tried including these extra dirs
sys.path.append("C:\Python27\Lib\site-packages\override")#tried including these extra dirs
sys.path.append("C:\Python27\Lib\site-packages\gi") #tried including these extra dirs

setup(
         options = {
                'py2exe': {
                            'bundle_files': 1,
                            #this does not work 'includes': ['Gtk']       
                            }
                },
console=["gui.py"],
zipfile=None
)
Run Code Online (Sandbox Code Playgroud)

运行时的可执行错误:

ImportError: MemoryLoadLibrary failed loading gi\_gi.pyd
Run Code Online (Sandbox Code Playgroud)

谢谢

python gtk py2exe pygobject

5
推荐指数
1
解决办法
1670
查看次数

标签 统计

gtk ×1

py2exe ×1

pygobject ×1

python ×1