加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

ImportError: No module named 'Tkinter' [clos

发布时间:2020-12-13 22:35:27 所属栏目:Linux 来源:网络整理
导读:跑maskrcnn报错:UserWarning: Matplotlib is currently using agg,which is a non-GUI backend,so cannot show the figure. % get_backend()) 可以在第一部分增加一行代码: matplotlib.use(‘TkAgg’) 最后显示如下: import matplotlib matplotlib.use(‘

跑maskrcnn报错:UserWarning: Matplotlib is currently using agg,which is a non-GUI backend,so cannot show the figure.
% get_backend())
可以在第一部分增加一行代码:
matplotlib.use(‘TkAgg’)

最后显示如下:

import matplotlib

matplotlib.use(‘TkAgg‘)

import matplotlib.pyplot as plt

?

于是尝试直接安装tkinter,结果没有发现tkinter包

[email?protected]:~$?pip3 install tkinter

?

于是,执行terminal 命令:

[email?protected]:~/linuxidc.com$?python3 -m tkinter

[email?protected]:~$?sudo apt search python3-tk

[email?protected]:~$?sudo apt install python3-tk

?

在安装完成之后,重新执行程序,然后报出同样的错误,问题仍然存在。

r如果发现有信息说,需要安装tk的开发类库,直接进行安装:

sudo apt install tk-dev (Ubuntu/Debian)

yum install tk-devel (CentOS)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读