0

I have installed Linux (aarch64) on a Raspberry Pi 4B and have both Python 3.7 and Python 3.9 installed. However, I am encountering an issue with a GUI visualization when running Python 3.9, specifically with the tkinter module.

The error message I receive is as follows: import tkinter as tk File "/usr/local/lib/python3.9/tkinter/__init__.py", line 37, in <module> import _tkinter # If this fails your Python may not be configured for Tk ModuleNotFoundError: No module named '_tkinter'

I have attempted to resolve the issue by installing the tkinter module using the command "python3.9 -m pip install tk". Unfortunately, the module is still not recognized. I would like to find a solution without having to reinstall Python. Reinstalling Python may potentially corrupt something, and I want to avoid any unintended consequences.

Any assistance in resolving this issue would be greatly appreciated.

ann
  • 1
  • 3
  • You can't install tkinter with pip. – Bryan Oakley May 31 '23 at 20:42
  • Thank you Bryan. I had read it here (https://www.tutorialspoint.com/how-to-install-tkinter-in-python) Could you please help me how can I install it now? – ann Jun 01 '23 at 09:38
  • You need to install tkinter using system package manager. Try using the system package manager to search for packages with "tkinter" or "tk" in the package name. – acw1668 Jun 02 '23 at 01:10

0 Answers0