Unidentified Error . Cx_freeze & Tkinter
I converted my py file to .exe using cx_freeze. On launch. It gives me the error https://www.upload.ee/image/7186947/Erir.PNG MY setup.py from cx_Freeze import setup, Executable
Solution 1:
You have not included the Tk and tcl run-times with your script.
You should use the include_files
arguement to include them.
You just need to make a few modifications to your script:
files = {"include_files": ["<Location to Python>/Python36-32/DLLs/tcl86t.dll", "<Location to Python>/Python36-32/DLLs/tk86t.dll"], "packages": ["tkinter"]}
And use:
options = {"build_exe": files},
And it should work.
So your script should look more like this:
from cx_Freeze import setup, Executable
import os
import sys
import os.path
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')
files = {"include_files": ["<Location to Python>/Python36-32/DLLs/tcl86t.dll", "<Location to Python>/Python36-32/DLLs/tk86t.dll"], "packages": ["tkinter"]}
setup(
name = "Removed",
version = "3.5",
description = "Removed",
options = {"build_exe": files},
executables = [Executable(script = "test1.py", base = "Win32GUI")])
I hope this helps.
Post a Comment for "Unidentified Error . Cx_freeze & Tkinter"