1

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)

j_4321
  • 15,431
  • 3
  • 34
  • 61
whiteRice
  • 31
  • 5

1 Answers1

0

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.

  • thank you. it's sounds really much easy but i do it now and i get exe. file, when i try to open it nothing happened – whiteRice Mar 18 '20 at 13:15