I am attempting to build an exe using cx_Freeze which uses several modules:
import tkinter as tk
from tkinter import ttk
import random, time, bluetooth, json, sys, os
from _thread import *
from threading import Thread, Lock
When I attempt to build the exe, it seems to work perfectly: it raises no errors and creates the build folder containing the exe file. However, when I attempt to open the exe file, it simply doesn't open. If briefly seems to flash a windows but then disappears. My setup.py is this:
from cx_Freeze import setup,Executable
import sys
import os
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')
includes = []
include_files = []
packages = []
base = "Win32GUI"
setup(
name = 'Buzzer',
version = '0.1',
description = 'Buzzer application',
author = 'Me',
executables = [Executable('Buzzer.py')]
)
The flashing screen contains the following traceback:
Traceback (most recent call last): File "C:\Users\X\AppData\Local\Programs\Python\Python37\lib\site-packages\cx_Freeze\initscripts__startup__.py", line 14, in run module.run() File "C:\Users\X\AppData\Local\Programs\Python\Python37\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run exec(code, m.dict) File "print.py", line 1, in File "C:\Users\X\AppData\Local\Programs\Python\Python37\lib\tkinter__init__.py", line 36, in import _tkinter # If this fails your Python may not be configured for Tk ImportError: DLL load failed: The specified module could not be found.