ipython运行报错No module named 'tkinter'

查看是否安装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
问题解决

参考此文

猜你喜欢

转载自blog.csdn.net/dqf009/article/details/84991856