-
Notifications
You must be signed in to change notification settings - Fork 8
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
cannot import name 'ImageTk' from 'PIL' on Fedora40 #62
Comments
Thank you for your report @plesiosaur, I hope this issue might help us understand better what is going on and how to fix it! When you say "install normally" (without a virtual environment) what method are you using? Thonny proposes several methods (I'm wary of the 3rd party distributions because they might be old): I'm on Manjaro and I have been using previously the https://thonny.org/installer-for-linux script method. I have also recently installed Thonny using Have you tried this or another method? |
Thanks for the quick response. The way I installed Thonny was... sudo dnf install thonny ...then I ran the command... thonny ...and went to Tools --> Manage plug-ins, did a search for py5, selected thonny-py5mode, and clicked Install. When it was done, I quit Thonny and restarted it. Still, the py5 menu is absent from the menubar. When I return to the plugin page, the buttons are for Upgrade, Uninstall, "...", and Close. Versions of my software (x86_64, Fedora40 Compiz-Mate) Next week I will try some other installation methods you pointed out. I am running this Linux in a Virtualbox VM so that it's easy to jump back to an old snapshot before I installed a particular thing and try it another way. |
The versions you have shown are the most recent and I was happy to learn this about the Fedora packaging! I'm afraid something else is not going well :( It looks like |
Without specifically installing these, I have them: $ dnf list python3-pillow python3-tkinter Something I learned might be important to have is python3-pillow-tk, thanks to this page: My system didn't have that package, so I installed it with... $ sudo dnf install python3-pillow-tk $ dnf list python3-pillow-tk That fixed my issue. Now in Thonny I have the py5 menu in the menubar. Thanks for the suggestions along the way. |
Hi. When I use a Python virtual environment, I can get Thonny installed in it and the thonny-py5mode plugin works. However, when I've deactivated the virtual environment and try to install normally, your plugin doesn't load correctly for me. This is on Fedora 40 Compiz-Mate. When Thonny opens up, there is no "py5" menu in the menubar. The error output is:
2 lines up from here, it mentions the file /usr/lib64/python3.12/site-packages/PIL/init.py Well, when I open that file and look for ImageTk myself, it's not in the list of modules. Here is the top part of that file, so you can see what I see.
What packages are installed? Here is the relevant stuff, I think.
$dnf list python3 python3-tkinter thonny
Last metadata expiration check: 0:22:01 ago on Thu 15 Aug 2024 10:47:16 AM EDT.
Installed Packages
python3.x86_64 3.12.4-1.fc40
python3-tkinter.x86_64 3.12.4-1.fc40
thonny.noarch 4.1.4-2.fc40
The text was updated successfully, but these errors were encountered: