开发者社区> 问答> 正文

import matplotlib.pyplot 报错,提示ImportError: No module named Tkinter

Traceback (most recent call last):
File "train.py", line 6, in

import matplotlib.pyplot as plt

File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 115, in

_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()

File "/usr/lib64/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup

globals(),locals(),[backend_name],0)

File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 6, in

from six.moves import tkinter as Tk

File "/usr/lib/python2.7/site-packages/six.py", line 203, in load_module

mod = mod._resolve()

File "/usr/lib/python2.7/site-packages/six.py", line 115, in _resolve

return _import_module(self.mod)

File "/usr/lib/python2.7/site-packages/six.py", line 82, in _import_module

__import__(name)

ImportError: No module named Tkinter

展开
收起
zidianjian 2017-09-11 19:34:48 9041 0
1 条回答
写回答
取消 提交回答
  • pip install Tkinter

    2019-07-17 21:34:58
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载