Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cx_Freeze - How to Include Modules

I've been having this problem with including things into my cx_Freeze script, what im trying to do is include easygui and sys, as i use them in my program. Any help would be appreciated!

Heres the code:

import sys
from cx_Freeze import setup, Executable


build_exe_options = {"packages": ["os"], "excludes": ["tkinter"] }


base = None
if sys.platform == "win32":
base = "Win32GUI"

setup(  name = "ProgramGUI",
        version = "0.1",
        description = "My GUI application!",
        options = {"build_exe": build_exe_options},
        executables = [Executable("ProgramGUI.py", base=base)])

So really all i need to know is how to incorparate Includes[ "sys", "easyGUI" ] Into the setup script :D

like image 963
Joseph Smith Avatar asked Oct 07 '22 21:10

Joseph Smith


1 Answers

Seriously, I think you just miss a small thing to tell cx_freeze to import easy_gui:

import sys
from cx_Freeze import setup, Executable


build_exe_options = {
    "packages": ["os", "sys"], 
    "excludes": ["tkinter"],
    "includes": ["easy_gui"] # <-- Include easy_gui
}

base = None
if sys.platform == "win32":
base = "Win32GUI"

setup(  name = "ProgramGUI",
        version = "0.1",
        description = "My GUI application!",
        options = {"build_exe": build_exe_options},
        executables = [Executable("ProgramGUI.py", base=base)])
like image 153
Stam Kaly Avatar answered Oct 13 '22 12:10

Stam Kaly