-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_tkinter.TclError: couldn't recognize image data #584
Comments
Yup, same issue here. Traceback (most recent call last): It works on Win10, as well |
The version of tkinter provided in macOS is probably outdated. If the following code: import tkinter
print(tkinter.TkVersion) gives anything below |
Appreciate your response. indeed, it is 8.5. I'll work on updating it |
Alright. Done these steps: brew install tcl-tk export PATH="/usr/local/opt/tcl-tk/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/tcl-tk/lib"
export CPPFLAGS="-I/usr/local/opt/tcl-tk/include"
export PKG_CONFIG_PATH="/usr/local/opt/tcl-tk/lib/pkgconfig" brew reinstall python make sure version is updated: brew info tcl-tk Then created new environment python3 -m venv myenv Activate it source myenv/bin/activate and run the *.py test file with: import tkinter
print(tkinter.TkVersion) So, I moved my projects files into the new environment and issue with not recognizing image data was solved. |
Desktop (please complete the following information):
ttkbootstrap version: 1.10.1
OS: Macos sonoma 14.5
python version: 3.9.6
Describe the bug
I was trying to develop an app with ttkbootstrap. However, when I was testing the package, it worked pretty on windows 10. But, when I was trying it on Macos, an error occurred. I created a virtual environment using the Macos default python version, and try to run the text reader demo (https://ttkbootstrap.readthedocs.io/en/latest/gallery/textreader/), it is not working. I checked online and found it was a common error with PhotoImage.
To Reproduce
DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning.
Traceback (most recent call last):
File "/Users/fengqingyu/Documents/appDevMaster/emc_ecoevalt/src/test_notebook.py", line 47, in
app = ttk.Window("Text Reader", "sandstone")
File "/Users/fengqingyu/Documents/appDevMaster/emc_ecoevalt/env/lib/python3.9/site-packages/ttkbootstrap/window.py", line 231, in init
self._icon = tkinter.PhotoImage(master=self, data=Icon.icon)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/tkinter/init.py", line 4064, in init
Image.init(self, 'photo', name, cnf, master, **kw)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/tkinter/init.py", line 4009, in init
self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't recognize image data
Expected behavior
No response
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: