Emy69 / CoomerDL

Coomer downloader
https://emydev.com/
136 stars 7 forks source link

Tkinter not found #5

Closed glsmith86 closed 5 months ago

glsmith86 commented 5 months ago

user@user-Aspire-F5-771G:~/CoomerDL$ python main.py Traceback (most recent call last): File "/home/user/CoomerDL/main.py", line 1, in from app.ui import ImageDownloaderApp File "/home/user/CoomerDL/app/ui.py", line 3, in import tkinter as tk ModuleNotFoundError: No module named 'tkinter'

Module tk is installed.

glsmith86 commented 5 months ago

New error after install the correct module:

user@user-Aspire-F5-771G:~/CoomerDL$ python3 main.py Traceback (most recent call last): File "/home/user/CoomerDL/main.py", line 8, in main() File "/home/user/CoomerDL/main.py", line 4, in main app = ImageDownloaderApp() File "/home/user/CoomerDL/app/ui.py", line 23, in init self.setup_window() File "/home/user/CoomerDL/app/ui.py", line 61, in setup_window self.iconbitmap("resources/img/window.ico") File "/home/user/.local/lib/python3.10/site-packages/customtkinter/windows/ctk_tk.py", line 232, in iconbitmap super().wm_iconbitmap(bitmap, default) File "/usr/lib/python3.10/tkinter/init.py", line 2109, in wm_iconbitmap return self.tk.call('wm', 'iconbitmap', self._w, bitmap) _tkinter.TclError: bitmap "resources/img/window.ico" not defined

Emy69 commented 5 months ago

To fix the self.iconbitmap("resources/img/window.ico") error on Linux, comment out the following line in the setup_window function in ui.py:


def setup_window(self):
    window_width, window_height = 1000, 680
    center_x = int((self.winfo_screenwidth() / 2) - (window_width / 2))
    center_y = int((self.winfo_screenheight() / 2) - (window_height / 2))
    self.geometry(f"{window_width}x{window_height}+{center_x}+{center_y}")
    # self.iconbitmap("resources/img/window.ico")  # <-- Comment this line
glsmith86 commented 5 months ago

That works! Thank You!