Skip to content Skip to sidebar Skip to footer

Cx_freeze Tkinter 'module Not Found'

I am trying to create an executable from my python scripts. I am using Windows 7, cx_freeze 5.0.2 and Python 3.6. I know Tkinter isn't included in the normal libraries and that you

Solution 1:

On the third line add ,"includes":["tkinter"]

Dependencies are automatically detected, but it might need fine tuning.

build_exe_options = {"packages": ["os"],"includes":["tkinter"]}

It worked for me when I run it with python setup.py build

Updated Code from Question:

import sys
from cx_Freeze import setup, Executable

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

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

setup(  name = "McCabe-Thiele",
        version = "0.1",
        description = "My GUI application!",
        options = {"build_exe": build_exe_options},
        executables = [Executable("GUI.py", base=base)])

Post a Comment for "Cx_freeze Tkinter 'module Not Found'"