python 报错: No module named '_tkinter'

首先安装python3-tk和tk-dev,然后重新编译安装python

sudo apt-get install python3-tk

sudo apt-get install tk-dev

然后进入python的安装目录

sudo make -j8

sudo make install

再次使用python import tkinter成功

你可能感兴趣的:(python 报错: No module named '_tkinter')