gtk3 Windows - Exe made by cx_freeze gives ValueError : Namespace Gtk not available
gtk3 Windows - Exe made by cx_freeze gives ValueError : Namespace Gtk not available
我在 Gtk3 Python3.4(Windows) 中构建了一个应用程序,它在 Pycharm 上运行良好,但是当我使用 cx_freeze 创建一个 exe 时,它给出了以下错误-
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module>
exec(code, m.__dict__)
File "obfuscated.py", line 2, in <module>
File "C:\Python34\lib\site-packages\gi\__init__.py", line 118, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available
我在我的应用程序中完成的导入是 -
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, Gio, GObject
import sqlite3
我的 setup.py 文件 -
from cx_Freeze import setup, Executable
#import os
#os.environ['TCL_LIBRARY'] = "C:\Users\BRAHMDEV\AppData\Local\Programs\Python\Python36\tcl\tcl8.6"
#os.environ['TK_LIBRARY'] = "C:\Users\BRAHMDEV\AppData\Local\Programs\Python\Python36\tcl\tk8.6"
executables = [
Executable("obfuscated.py",
icon="evm_bg_KYa_icon.ico")
]
buildOptions = {"packages":["sqlite3", "gi"], "include_files":["mydatabase.db", "AgeSearch.png", "android.png", "candidate.jpg",
"CasteSearch.png", "duplicate.png", "FileStyle.css", "GenSearch.png", "Hof.png", "Placeholder.png", "voter slip.png"]}
setup(name="Voter Search Engine",
version="2.1.3",
description="Voter Search Engine Setup",
options={"build_exe":buildOptions},
executables=executables,
)
当我执行 python setup.py 构建时,这就是发生的事情 -
好吧,我在 Pyinstaller 上试过这个也得到了同样的错误,但找到了解决方案
here
我在 Gtk3 Python3.4(Windows) 中构建了一个应用程序,它在 Pycharm 上运行良好,但是当我使用 cx_freeze 创建一个 exe 时,它给出了以下错误-
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module>
exec(code, m.__dict__)
File "obfuscated.py", line 2, in <module>
File "C:\Python34\lib\site-packages\gi\__init__.py", line 118, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available
我在我的应用程序中完成的导入是 -
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, Gio, GObject
import sqlite3
我的 setup.py 文件 -
from cx_Freeze import setup, Executable
#import os
#os.environ['TCL_LIBRARY'] = "C:\Users\BRAHMDEV\AppData\Local\Programs\Python\Python36\tcl\tcl8.6"
#os.environ['TK_LIBRARY'] = "C:\Users\BRAHMDEV\AppData\Local\Programs\Python\Python36\tcl\tk8.6"
executables = [
Executable("obfuscated.py",
icon="evm_bg_KYa_icon.ico")
]
buildOptions = {"packages":["sqlite3", "gi"], "include_files":["mydatabase.db", "AgeSearch.png", "android.png", "candidate.jpg",
"CasteSearch.png", "duplicate.png", "FileStyle.css", "GenSearch.png", "Hof.png", "Placeholder.png", "voter slip.png"]}
setup(name="Voter Search Engine",
version="2.1.3",
description="Voter Search Engine Setup",
options={"build_exe":buildOptions},
executables=executables,
)
当我执行 python setup.py 构建时,这就是发生的事情 -
好吧,我在 Pyinstaller 上试过这个也得到了同样的错误,但找到了解决方案 here