When using cx_Freeze and tkinter I get: “DLL load failed: The specified module could not be found.” (Python 3.5.3)

Found a solution! I had to copy the tk86t.dll and tcl86t.dll files from my python directory’s DLLs folder into the build folder with the main.py I was trying to compile. This, in conjunction with having set TCL_LIBRARY=C:\Users\VergilTheHuragok\AppData\Local\Programs\Python\Python35\tcl\tcl8.6 set TK_LIBRARY=C:\Users\VergilTheHuragok\AppData\Local\Programs\Python\Python35\tcl\tk8.6 at the top of my compile.bat, and including “include_files”: [“tcl86t.dll”, “tk86t.dll”] in my build_exe_options in setup.py, … Read more

What could be the reason for fatal python error:initfsencoding:unable to load the file system codec?

Fixed in 4c18633. The problem is that for version x64 for Python 3.7 it is not working due to class config for freezer.py. You need to go cx_Freezer installation folder. If you have a virtual environment, go to your environment folder \lib\site-packages\cx_Freeze, find the freezer.py and add the code found on the commit. You can … Read more

tkinter program compiles with cx_Freeze but program will not launch

Try to modify you setup.py as follows: import sys from cx_Freeze import setup, Executable import os PYTHON_INSTALL_DIR = os.path.dirname(sys.executable) os.environ[‘TCL_LIBRARY’] = os.path.join(PYTHON_INSTALL_DIR, ‘tcl’, ‘tcl8.6’) os.environ[‘TK_LIBRARY’] = os.path.join(PYTHON_INSTALL_DIR, ‘tcl’, ‘tk8.6’) include_files = [(os.path.join(PYTHON_INSTALL_DIR, ‘DLLs’, ‘tk86t.dll’), os.path.join(‘lib’, ‘tk86t.dll’)), (os.path.join(PYTHON_INSTALL_DIR, ‘DLLs’, ‘tcl86t.dll’), os.path.join(‘lib’, ‘tcl86t.dll’))] base = None if sys.platform == ‘win32’: base=”Win32GUI” executables = [Executable(‘SimpleTkApp.py’, base=base)] setup(name=”simple_Tkinter”, version=’0.1′, … Read more

Getting “ImportError: DLL load failed: The specified module could not be found” when using cx_Freeze even with tcl86t.dll and tk86t.dll added in

In cx_Freeze version 5.1.1, the included modules are in a subdirectory lib of the build directory. The tcl86t.dll and tk86t.dll DLLs apparently need to be moved there as well. You can do this with the following modification of your setup.py script: build_exe_options = {“packages”: [“winsound”, “random”, “time”, “tkinter”, “math”], “include_files”: [(‘tcl86t.dll’, os.path.join(‘lib’, ‘tcl86t.dll’)), (‘tk86t.dll’, os.path.join(‘lib’, … Read more

Use cx-freeze to create an msi that adds a shortcut to the desktop

To create a shortcut to the application, give the shortCutName and shortcutDir options to the Executable. The shortcutDir can name any of the System Folder Properties (thanks Aaron). For example: from cx_Freeze import * setup( executables = [ Executable( “MyApp.py”, shortcutName=”DTI Playlist”, shortcutDir=”DesktopFolder”, ) ] ) You can also add items to the MSI Shortcut … Read more

cx_Freeze converted GUI-app (tkinter) crashes after pressing plot button

I found a potential solution (or at least an explanation) for this problem while testing PyInstaller with the same test.py. I received error message about a dll file being missing, that file being mkl_intel_thread.dll. I searched for that file and it was found inside numpy folder. I copied files matching mkl_*.dll and also libiomp5md.dll to … Read more