I am trying to use Tkinter in a Python 3.10 project. I have created a virtual environment with Python 3.10 and have installed Tkinter. When I run import tkinter
I get the following error.
Traceback (most recent call last):
File "/home/xxx/yyy/main.py", line 11, in <module>
import tkinter
File "/usr/local/lib/python3.10/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'
However, if I do the same outside of a virtual environment with Python 3.9, or create a new virtual environment with Python 3.9, it runs fine without error.
Is Tkinter not supported yet in 3.10, or could I be doing something else wrong?