我正在try 在CentOS-7下安装(通过pyenv)Python-3.11.4.它可以安装,但没有安装图形用户界面.我收到以下错误消息:
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
而在同一台计算机上成功安装了Python-3.9.16.根据Python 3.11 Build Changes的要求,要求安装"Tcl/Tk version 8.5.12 or newer".我有过
$ rpm -q tk tk-devel
tk-8.5.13-6.el7.x86_64
tk-devel-8.5.13-6.el7.x86_64
同一页上显示的是"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.",它也已安装:
$ rpm -q pkgconfig
pkgconfig-0.27.1-4.el7.x86_64
你能帮我了解一下安装_tkinter
失败的可能原因吗?
非常感谢您的帮助!