I would like to compile an application using cx_freeze. I designed an
application using Qt Designer. I've exported the code as a .ui file.
After export I've converted the .ui file into .py file using the
pyuic5 command and the Pyqt5 library. Under my IDE (spyder or pycharm)
the application works without any problems. However using cx_freeze I
have issues in converting this application to standalone .exe under
windows 7. Could you please help in solving this issue?
Hi,
I don't know about QT, I use wxPython. And I'm not an expert of
cx_Freeze, just a basic user.
But can you describe :
- which cx_Freeze version do you use ?
- How did you installed cx_Freeze ? From sources ? From 'pip' command ?
- which python version do you use ?
- what are the kind of conversion's issues you are talking about ?
Meanwhile, here's an example of *setup.py* (to use with cx_Freeze 4.3.3
and python 2.7.x) file I use for wxPython's projetct, that you can adapt
to QT :
import sys
from cx_Freeze import setup, Executable
includefiles = ['./images/','./locale/','./logs/']
includes = []
excludes = ['FixTk', 'tcl', 'tk', '_tkinter', 'Tkinter',
'collections.abc']
packages = ['matplotlib.backends.backend_wxagg']
build_exe_options = {"packages":packages,
'include_files':includefiles, 'excludes': excludes }
# GUI applications require a different base on Windows (the default
is for a
# console application).
base_sys = None
if sys.platform == "win32":
base_sys = "Win32GUI"
shortcut_table = [
("DesktopShortcut", # Shortcut
"DesktopFolder", # Directory_
"MyApplication", # Name
"TARGETDIR", # Component_
"[TARGETDIR]MyApplication.exe",# Target
None, # Arguments
None, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR' # WkDir
),
("StartupShortcut", # Shortcut
"ProgramMenuFolder", # Directory_
"MyApplication", # Name
"TARGETDIR", # Component_
"[TARGETDIR]MyApplication.exe", # Target
None, # Arguments
None, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR' # WkDir
),
]
# Now create the table dictionary
msi_data = {"Shortcut": shortcut_table}
# Change some default MSI options and specify the use of the above
defined tables
bdist_msi_options = {'data': msi_data}
target = Executable(
script="MyApplication.py",
base = base_sys,
icon="./images/favicon.ico",
)
setup(
name = "MyApplication",
version = "1.0",
author = "Zylyco",
description = "What's about MyApplication",
options = {'build_exe': build_exe_options, "bdist_msi":
bdist_msi_options},
executables = [target],
)
You have to launch the command :
python setup.py bdist_msi
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
cx-freeze-users mailing list
cx-freeze-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users