I’m trying to build a executable with the py2exe package.
My code is :
import tkinter
import customtkinter
customtkinter.set_appearance_mode(“System”) # Modes: system (default), light, dark
customtkinter.set_default_color_theme(“blue”) # Themes: blue (default), dark-blue, green
app = customtkinter.CTk() # create CTk window like you do with the Tk window
app.geometry(“400x240”)
def button_function():
print(“button pressed”)
Use CTkButton instead of tkinter Button
button = customtkinter.CTkButton(master=app, text=“CTkButton”, command=button_function)
button.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)
app.mainloop()
and my setupfile is
from distutils.core import setup
#from setuptools import setup
import py2exe
import customtkinter
import tkinter
setup(
options = {‘py2exe’: {
‘compressed’: True,
‘includes’: ‘customtkinter’
}
},
windows = [‘Projekttagebuch.py’]
)
By building it with the command
→ build_exe Build_EXE.py
severall issuses occur. First lots of modules are missing and second the AttributeError: ‘Namespace’ object has no attribute ‘libname’ occurs.