Skip to content
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

Mac OSX tkinter.TclError - fix inside #3

Closed
Tamtatatam opened this issue Jun 4, 2020 · 2 comments
Closed

Mac OSX tkinter.TclError - fix inside #3

Tamtatatam opened this issue Jun 4, 2020 · 2 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@Tamtatatam
Copy link

Tamtatatam commented Jun 4, 2020

Hi
On some OSX systems the GUI does not start because of an tkinter error:

Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.7/site-packages/boldigger/main.py", line 119, in
main()
File "/usr/local/lib/python3.7/site-packages/boldigger/main.py", line 47, in main
event, values = window.read(timeout = 100)
File "/usr/local/lib/python3.7/site-packages/PySimpleGUI/PySimpleGUI.py", line 6957, in Read
results = self._read(timeout=timeout, timeout_key=timeout_key)
File "/usr/local/lib/python3.7/site-packages/PySimpleGUI/PySimpleGUI.py", line 6995, in _read
self._Show()
File "/usr/local/lib/python3.7/site-packages/PySimpleGUI/PySimpleGUI.py", line 6831, in _Show
StartupTK(self)
File "/usr/local/lib/python3.7/site-packages/PySimpleGUI/PySimpleGUI.py", line 11301, in StartupTK
ConvertFlexToTK(my_flex_form)
File "/usr/local/lib/python3.7/site-packages/PySimpleGUI/PySimpleGUI.py", line 11203, in ConvertFlexToTK
PackFormIntoFrame(MyFlexForm, master, MyFlexForm)
File "/usr/local/lib/python3.7/site-packages/PySimpleGUI/PySimpleGUI.py", line 10577, in PackFormIntoFrame
photo = tk.PhotoImage(data=element.Data)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/init.py", line 3545, in init
Image.init(self, 'photo', name, cnf, master, **kw)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/init.py", line 3501, in init
self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't recognize image data

This seems to be a problem with the Tcl/Tk version 8.5 that comes with the python3 version installed with 'brew'. It can be fixed by uninstalling python3 and manually reinstalling it with the latest version from https://www.python.org/downloads/.

@DominikBuchner DominikBuchner added enhancement New feature or request question Further information is requested labels Jun 4, 2020
@DominikBuchner DominikBuchner pinned this issue Jun 4, 2020
@DominikBuchner
Copy link
Owner

With the fix provided there is nothing more to do here. Thanks for pointing this out for all Mac OS users.

@DominikBuchner DominikBuchner changed the title GUI does not start because of _tkinter.TclError Mac OSX tkinter.TclError - fix inside Jun 4, 2020
@OndroV
Copy link

OndroV commented Jan 28, 2021

The following solution is also useful for ubuntu users, because it is not recommended to uninstall default python from ubuntu:
https://stackoverflow.com/questions/43397162/show-matplotlib-plots-and-other-gui-in-ubuntu-wsl1-wsl2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants