尝试使用pip安装提示找不到这个包

python3.6 -m pip install tkinter
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none)
ERROR: No matching distribution found for tkinter

kinter是Python图形工具箱,是一个单独的软件并不是一个简单的Python程序包,因此需要独立安装。

1、搜索一下安装包
sudo yum search python3-tk

yum search python3-tk
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Determining fastest mirrors
============================================================================= N/S matched: python3-tk =============================================================================
python3-tkinter.i686 : A GUI toolkit for Python
python3-tkinter.x86_64 : A GUI toolkit for Python

  Name and summary matches only, use "search all" for everything.

系统找到了两个可用的包,根据我的当前环境选择python3-tkinter.x86_64
2、执行安装
sudo yum install python3-tkinter.x86_64

安装之后Python不再报错了。

Logo

更多推荐