1
votes

I wrote some files in python and want to create an exe file. To do it with cx_freeze I create a setup.py file like that:

import sys
from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"includes": ["tkinter"]}

# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(
    name = "LSR",
    version = "0.1",
    description = "",
    options = {"build_exe": build_exe_options},
    executables = [Executable("LS-R.py", base = base)])

then I write in the cmd :

python setup.py build

and I get this error:

error during GetDependentFiles() of "c:\users\appdata\local\programs\python\python36\dlls\tk86t.dll": (0, 'The system cannot find the file specified', 'c:\users\appdata\local\programs\python\python36\dlls\tk86t.dll', 2, None) copying C:\Users\AppData\Local\Programs\Python\Python36\lib\site-packages\pywin32_system32\pywintypes36.dll -> build\exe.win-amd64-3.6\lib\pywintypes36.dll copying C:\Users\AppData\Local\Programs\Python\Python36\lib\site-packages\pywin32_system32\pythoncom36.dll -> build\exe.win-amd64-3.6\lib\pythoncom36.dll

exe file created , but when I try open it I get this message : ModuleNotFoundError:No module named 'tkinter'

someone know what is the problem? and what should I do to fix it? (I'm working in Windows OS)

1
You want to create a exe file,Why don't you just use pyinstaller? - jizhihaoSAMA
The error indicates that tk86t.dll cannot be found when creating the executable. You should check why it is missing in your Python installation. - acw1668
it's not working with pyinstaller too. I have the "tk86t.dll" in my python installation - whiteRice
You should check the path of tk86t.dll in the error message. - acw1668

1 Answers

0
votes

Its Quite simple use; pip install auto-py-to-exe

It will give you A GUI and is as simple as it gets. It is based on

Pyinstaller, cx-freeze, etc

See PyPI.

I was having the same problems even in Pyinstaller but this is the easiest way without any errors and is the most Effective way.

After Installation in cmd type

auto-py-to-exe

This will open a new Browser window with a beautiful and easy to use GUI. It works for Tkinter well as I have used to to create like 50 Tkinter .exe files. I made a program for activating windows in Tkinter with this; See: https://drive.google.com/file/d/1RKLIlGcrra1pC5MyaPWrlQa1tW25Wc_q/view  I hope this makes your job quite easy.