I am trying to build my GUI application using cx_Freeze
. The setup.py
is as follows:
from cx_Freeze import setup, Executable
import
Try to remove the (unnecessary?) line
import PyQt5.Qt
from your setup.py
script.
EDIT after the OP removed this line:
Try to remove the unnecessary os.environ
statements, these are for tkinter
, maybe they conflict. Remove the 3 DLLs entries in the include_files
(keep only the icon). Add 'atexit'
to the includes
list, see the cx_Freeze PyQt5 example.
Try to re-install PyQt5
and cx_Freeze
, see potential caveats in ImportError: No module named PytQt5 and PyQt5 and QtGui module not found.
If this still does not work, maybe there is a conflict with another package used in your application. To find out, make a minimal example using only PyQt5
, such as the cx_Freeze PyQt5 example and try to freeze it. If it works, add the other packages one by one, checking the frozen application at each step.
EDIT II:
PyQt4
if it is or has been installed on your system. Make sure to remove any import of PyQt4
from your application and maybe add an entry excludes: ['PyQt4']
to the build_exe
dictionary in your setup.py
script.