5 AnswersNew Answer
A few reasons this may happen. 1. You don't have PIL installed in the version or virtual environment that you're using to build this project. 2. PIL is the incorrect import. Try the following; import Image from PIL import Image import pillow etc. https://stackoverflow.com/questions/8863917/importerror-no-module-named-pil https://github.com/python-pillow/Pillow/issues/3851 https://cloudstack.ninja/major-tonality/how-to-manually-add-pil-module-to-pyinstaller-exe/
https://stackoverflow.com/questions/64057842/how-to-manually-add-pil-module-to-pyinstaller-exe also this, in case you use pycharm. we used to make pyinstaller images of our software from 2012 to 2017 but abandoned it in the last years because they would not be truly portable anymore. Many systems would block them after spectre and meltdown. as ChaoticDawg writes, PIL has been replaced by pillow
what is an exercise file?
JIC YDK, PIL is an abbreviation for Python Imaging Library, and is not a dependency of Tkinter’s AFAIK (and no i really wasnt trying to use as many acronyms as possible).
IDK, Pyinstaller for TK may depends on PIL and you must install it ASAP