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

ImportError: cannot import name 'ImageTk' from 'PIL' #181

Open
su542sa opened this issue Aug 7, 2024 · 0 comments · May be fixed by #183
Open

ImportError: cannot import name 'ImageTk' from 'PIL' #181

su542sa opened this issue Aug 7, 2024 · 0 comments · May be fixed by #183

Comments

@su542sa
Copy link

su542sa commented Aug 7, 2024

Hi,
I am following this tutorial for running YOLO v8 to detect and automatically identify number plates from a video. I am currently on, 30:02 time in the video, where he runs the code successfully. However, my code brings the following error:
Traceback (most recent call last): File "/home/pi/yolotest.py", line 3, in <module> from sort.sort import * File "/home/pi/sort/sort.py", line 23, in <module> matplotlib.use('TkAgg') File "/home/pi/env/lib/python3.11/site-packages/matplotlib/__init__.py", line 1255, in use plt.switch_backend(name) File "/home/pi/env/lib/python3.11/site-packages/matplotlib/pyplot.py", line 415, in switch_backend module = backend_registry.load_backend_module(newbackend) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/env/lib/python3.11/site-packages/matplotlib/backends/registry.py", line 323, in load_backend_module return importlib.import_module(module_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/env/lib/python3.11/site-packages/matplotlib/backends/backend_tkagg.py", line 1, in <module> from . import _backend_tk File "/home/pi/env/lib/python3.11/site-packages/matplotlib/backends/_backend_tk.py", line 16, in <module> from PIL import Image, ImageTk ImportError: cannot import name 'ImageTk' from 'PIL' (/usr/lib/python3/dist-packages/PIL/__init__.py)

Note that I am using a Raspberry Pi 5 4 GB RAM running Raspberry Pi OS 64-bit. Along with that, all the system packages and libraries(including sort folder downloaded) are in a python virtual environment. Please help.

Bilal-irfan added a commit to Bilal-irfan/sort that referenced this issue Sep 24, 2024
@Bilal-irfan Bilal-irfan linked a pull request Sep 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant