I am trying to install (through pyenv) Python-3.11.4 under CentOS-7. It installs but without GUI. I get the following error message:
Installing Python-3.11.4...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/.../pyenv/versions/3.11.4/lib/python3.11/tkinter/__init__.py", line 38, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named '_tkinter'
WARNING: The Python tkinter extension was not compiled and GUI subsystem has been detected. Missing the Tk toolkit?
Installed Python-3.11.4 to /.../pyenv/versions/3.11.4
While Python-3.9.16 installs successfully on the same machine. According to Python 3.11 Build Changes, the requirement is to have "Tcl/Tk version 8.5.12 or newer" installed. I have
$ rpm -q tk tk-devel tcl tcl-devel
tk-8.5.13-6.el7.x86_64
tk-devel-8.5.13-6.el7.x86_64
tcl-8.5.13-8.el7.x86_64
tcl-devel-8.5.13-8.el7.x86_64
The same page says "Tcl/Tk, and uuid flags are detected by pkg-config (when available). tkinter now requires a pkg-config command to detect development settings for Tcl/Tk headers and libraries.", which is also installed:
$ rpm -q pkgconfig
pkgconfig-0.27.1-4.el7.x86_64
Could you please help me to understand what might be the reason of the failure to install _tkinter
?
Thank you very much for your help!