Hi I know this is an old post but I've been through every forum trying to fix this issue. I need tkinter for my ubuntu virtual machine, I've checked im in the correct python, installed all the packages including the one Robert suggested (though installing from distro so I shouldn't have to). Nothing. I even tried manually copying the tk8.6 directory into lib and tcl8.6, no effect.
Just:
lewie@lewie-virtual-machine:~/Downloads$ python3
Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> tkinter._test()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.10/tkinter/__init__.py", line 4586, in _test
root = Tk()
File "/usr/lib/python3.10/tkinter/__init__.py", line 2299, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: Can't find a usable tk.tcl in the following directories:
/usr/local/lib/tcl8.6/tk8.6 /usr/local/lib/tk8.6 /usr/lib/tk8.6 /usr/lib/tk8.6 /lib/tk8.6 /usr/library
This probably means that tk wasn't installed properly.
>>>
incidentally the /tk8.6/ dir only contains "pkgIndex.tcl"
in case that's what's wrong.
Any help would be great
Lewie