开发者社区> 问答> 正文

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

zidianjian 2017-09-11 19:34:48 5079

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

Python
分享到
取消 提交回答
全部回答(1)
  • jesuszhu_
    2019-07-17 21:34:58

    pip install Tkinter

    0 0

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题