CX_Freeze application closes directly after startup
I'm relatively new to Python, but I made my first program and want to easily distribute it. I succesfully pip installed cx_freeze version 5.1.1 and I have successfully built the application. But as soon as I start the .exe, it closes, without giving me any information on the error. My setup.py:
from cx_Freeze import setup, Executable import os.path os.environ['TCL_LIBRARY'] = r'C:\Python36\tcl\tcl8.6' os.environ['TK_LIBRARY'] = r'C:\Python36\tcl\tk8.6' setup(name='PythonAutoTyper', version='0.1', description='PATv0.1', executables = [Executable("distme.py")])
I have already searched for it on Google, and came across this page: cx_Freeze Exe Application closes as soon as opens , but that doesn't solve my problem since my program is named distme.py.
The only PyPi library that I'm using in my application is PyAutoGUI.
Thanks in advance.
Edit: I've tried to run it via the command prompt, and it gave an error (luckily):
Traceback (most recent call last): File "C:\Python36\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 14, in run module.run() File "C:\Python36\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run exec(code, m.__dict__) File "distme.py", line 3, in <module> File "C:\Python36\lib\tkinter\__init__.py", line 36, in <module> import _tkinter # If this fails your Python may not be configured for Tk ImportError: DLL load failed: The specified module could not be found.
So I guess I have a problem with tkinter.