#๐Ÿ”’ pyinstaller and TkInter

5 messages ยท Page 1 of 1 (latest)

winter prism
#

I'm trying to turn my sample app (qrcode gen with TkInter) to executable using pyinstaller. The app builds, but when it's started I get:

Exception in Tkinter callback
Traceback (most recent call last):
  File "PIL/ImageTk.py", line 65, in _pyimagingtkcall
_tkinter.TclError: invalid command name "PyImagingPhoto"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tkinter/__init__.py", line 1921, in __call__
  File "qrcode_gen.py", line 10, in generuj_qr
  File "PIL/ImageTk.py", line 129, in __init__
  File "PIL/ImageTk.py", line 183, in paste
  File "PIL/ImageTk.py", line 69, in _pyimagingtkcall
ModuleNotFoundError: No module named 'PIL._tkinter_finder'

Any ideas howto resolve it so the pyinstaller would pack it all?

rugged pendantBOT
#

@winter prism

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

winter prism
#

ok, solved it - I've added :

from PIL import _tkinter_finder
rugged pendantBOT
#

@winter prism

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.