dhhruv / YouTua

🎬 YouTua is a GUI Program to download videos/playlists from various supported sites.
MIT License
52 stars 9 forks source link

Traceback error (with icon) #4

Closed Mennaruuk closed 3 years ago

Mennaruuk commented 3 years ago

I'm facing a traceback error involving the tkinter icon. I would appreciate any help in working around this problem so I can launch YouTua. Thank you!

[Menna@linux YouTua]$ python YouTua.py
Traceback (most recent call last):
  File "/home/Menna/YouTua/YouTua.py", line 418, in <module>
    ROOT.iconbitmap(path_to_ico)
  File "/usr/lib/python3.9/tkinter/__init__.py", line 2072, in wm_iconbitmap
    return self.tk.call('wm', 'iconbitmap', self._w, bitmap)
_tkinter.TclError: bitmap "/home/Menna/YouTua/YouTua.ico" not defined
dhhruv commented 3 years ago

As instructed in README, you've to place the ffmpeg build of Linux in the directory where you're running YouTua. Also, you've to copy/cut the YouTua.ico from files folder to the same directory. Maybe, that's why you're getting this error so this should help.

Mennaruuk commented 3 years ago

I put the ffmpeg folder I got from the latest ffmpeg source code and pasted it into the YouTua directory. I also duplicated the .ico and placed it in the same directory. I'm still getting the same error. Running Python 3.9.1. image

Traceback (most recent call last):
  File "/home/Menna/YouTua/YouTua.py", line 418, in <module>
    ROOT.iconbitmap(path_to_ico)
  File "/usr/lib/python3.9/tkinter/__init__.py", line 2072, in wm_iconbitmap
    return self.tk.call('wm', 'iconbitmap', self._w, bitmap)
_tkinter.TclError: bitmap "/home/Menna/YouTua/YouTua.ico" not defined
dhhruv commented 3 years ago

Check _tkinter.TclError and try again. Maybe that helps.

Mennaruuk commented 3 years ago

I fixed the issue by:

  1. Adding from tkinter import PhotoImage to the top of YouTua.py
  2. Changing ROOT.iconbitmap(path_to_ico) to ROOT.iconphoto(True, PhotoImage(path_to_ico))

(source)

I'm not sure if other users are facing the same problem on Linux distros. If so, replacing these lines can be helpful in solving this issue since now I've been able to reproduce the problem on two different distros. Thank you for your help @dhhruv