I'm getting an error while using tkinter. I have installed python using pyenv.
>>> import tkinter
>>> tkinter._test()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/hrj/.pyenv/versions/3.8.16/lib/python3.8/tkinter/__init__.py", line 4557, in _test
root = Tk()
File "/Users/hrj/.pyenv/versions/3.8.16/lib/python3.8/tkinter/__init__.py", line 2272, in __init__
self._loadtk()
File "/Users/hrj/.pyenv/versions/3.8.16/lib/python3.8/tkinter/__init__.py", line 2288, in _loadtk
raise RuntimeError("tk.h version (%s) doesn't match libtk.a version (%s)"
RuntimeError: tk.h version (8.5) doesn't match libtk.a version (8.6)
The error is similar to this question, but my tk.h version is lower. Any way to upgrade this?
tkinter._test() should display a test window but I get a error. In stackoverflow and GitHub people usually have a lower version of libtk.a but mine is the reverse. So those solutions won't work.