Problems with sv_ttk and pyinstaller

Viewed 110

Good Night for everyone, I can't make this code in .py to work when compiling it to .exe with pyinstaller, not even with --onefile

#imports >
from tkinter import *
from tkinter import ttk
import sv_ttk as sv
#< imports

#definitions >
def themeSwitch():
    if(toggleThemeButton['text']==""):
        toggleThemeButton['text']=""
        sv.use_light_theme()
    else:
        toggleThemeButton['text']=""
        sv.use_dark_theme()

def showSearch():
    if(searchButton['text']=="Search"):
        searchButton['text']="..."
        global searchBar
        searchBar = ttk.Entry(mainWindow, style="TEntry")
        searchBar.pack(side=BOTTOM)
    else:
        searchButton['text']="Search"
        searchBar.destroy()
#< definitions

#Window >
mainWindow = Tk()
sv.toggle_theme()
mainWindow.attributes('-fullscreen', True)
mainWindow.title("Bubble System")
mainWindow.iconbitmap(default='bubble.ico')
toggleThemeButton = ttk.Button(mainWindow, text="", style="TButton", command=themeSwitch)
toggleThemeButton.pack(side=RIGHT)
searchButton = ttk.Button(mainWindow, text="Search", style="TButton", command=showSearch)
searchButton.pack(side=BOTTOM, pady=20)
#< Window

mainWindow.mainloop()

The error message:

"Traceback (most recent call last): File "bubble.py", line 29, in File "sv_ttk_init_.py", line 18, in wrapper _tkinter.TclError: couldn't read file "C:\Users\cazpj\Documents\Programming\dist\bubble\sv_ttk\sun-valley.tcl": no such file or directory [3864] Failed to execute script 'bubble' due to unhandled exception!"

The code works like a charm while running into VISUAL STUDIO, please help!

1 Answers

I just needed to write --collect-data sv_ttk as a PyInstaller argument.

Related