Running Python 3.5.3 and the latest cx_Freeze. When building the exe, everything runs fine. However, when I run the exe I get a dialogue message saying:
# If this fails your Python may no be configured for Tk
ImportError: DLL load failed: The specified module could not be found.
I followed the solution found here (the second answer using the the file method rather than explicitly specifying the path -- which is what I tried first with the same result). And also tried the solution found here, but I'm still getting the error when I run the exe.
Here's my setup.py file:
import os
import sys
from cx_Freeze import setup, Executable
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
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')
options = {
'build_exe': {
'include_files':[
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
],
},
}
setup(
name="Drawings Converter",
version="1.0",
description="Converts PDF files named by part number to PDF files named by reference number",
executables=[Executable("DrawingsConverter.py", base="Win32GUI")])
Anyone have an idea of what I might be missing? This is the first time I've used cx-Freeze, and I'm also quite new to Python. Any detailed info on the problem that would help me learn to avoid this in the future would be very appreciated. Thanks in advance!
EDIT: I solved the issue by copying the .dll files over to the build directory. However, I would still appreciate it if anyone could give me any insight as to why cx_Freeze was not doing this or could not find them.