matplotlib error - no module named tkinter

后端 未结 16 1704
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 04:10

I tried to use the matplotlib package via Pycharm IDE on windows 10. when I run this code:

from matplotlib import pyplot

I get the followin

16条回答
  •  悲&欢浪女
    2020-11-28 04:36

    sudo apt-get install python3-tk
    

    Then,

    >> import tkinter # all fine
    

    Edit:

    For Windows, I think the problem is you didn't install complete Python package. Since Tkinter should be shipped with Python out of box. See: http://www.tkdocs.com/tutorial/install.html

    I suggest install ipython, which provides powerful shell and necessary packages as well.

提交回复
热议问题