You still need to include both dll files, in your case they are supposed to be located in:
C: \ Program Files \ Python35-32 \ DLLs
Check that this directory exists and that it contains the files:
tk86t.dll
tcl86t.dll
The following setup.py should not give any problem (tested in Python 3.5 and 3.6 with cx_Freeze 5.0.2 and a simple app in Tkinter in Windows 10 .):
import os
import sys
import cx_Freeze
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')
include_files = [os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll')]
executables = [cx_Freeze.Executable("programa1.py",
base = "Win32GUI",
icon = None)]
options = {"build_exe": {"packages": [],
"includes": [],
"include_files": include_files
}
}
cx_Freeze.setup(
name = "PDF",
version = "1.0",
description = "Formulario a PDF",
options = options,
executables = executables)
Make sure that when you execute setup.py build
in CMD you call the right interpreter (important if you have different versions of Python installed), in your case it should be:
py -3.5-32 setup.py build
or directly:
"C:\Program Files\Python35-32\python" setup.py build