Skip to content Skip to sidebar Skip to footer

Convert Tkinter Py File Into EXE File

im trying to convert my tkinter file into EXE using cx_freeze, but i got this error all the time the error translation of the hebrew part: module didnt found my setup file code is:

Solution 1:

In your Python directory's DLLs folder you will find tk86t.dll and tcl86t.dll. You have to copy them into the build folder with the main.py you want to compile.

Then you have to add these two files to the include_files parameter in your setup.py.

Now, your setup.pyshould look like something like this :

import os
from cx_Freeze import setup, Executable

os.environ['TCL_LIBRARY'] = 'c:/python36/tcl/tcl8.6'
os.environ['TK_LIBRARY'] = 'c:/python36/tcl/tk8.6'

buildOptions = dict(
    packages = [],
    excludes = [],
    include_files=['c:/python36/DLLs/tcl86t.dll', 'c:/python36/DLLs/tk86t.dll']
)

import sys
base = 'Win32GUI' if sys.platform=='win32' else None

executables = [
    Executable('editor.py', base=base)
]

setup(name='editor',
      version = '1.0',
      description = '',
      options = dict(build_exe = buildOptions),
      executables = executables)

Of course you may have to adapt the directories paths to make it work.


Post a Comment for "Convert Tkinter Py File Into EXE File"