查看是否安装tkinter
sudo apt search python3-tk
显示如下
Sorting… Done
Full Text Search… Done
python3-tk/bionic-updates 3.6.7-1~18.04 amd64
Tkinter - Writing Tk applications with Python 3.x
python3-tk-dbg/bionic-updates 3.6.7-1~18.04 amd64
Tkinter - Writing Tk applications with Python 3.x (debug extension)
python3-tksnack/bionic,bionic,xenial,xenial 2.2.10.20090623-dfsg-6 all
Sound extension to Tcl/Tk and Python/Tkinter - Python 3.x library
发现已安装,然后有博客说需要安装tk的开发类库
sudo apt install tk-dev
问题解决