ModuleNotFoundError: No module named '_tkinter'

>>> import matplotlib.pyplot as pltpython

  File "/usr/local/lib/python3.6/tkinter/__init__.py", line 36, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'shell


緣由是:沒有安裝tkinter包ide

ubutun16下的解決方案是:this

sudo apt-get install tk8.6-devget

進入到python的安裝目錄下:it

make
class

sudo make installimport

而後輸入python進入shell:module

import   thinter    #不報錯表示安裝成功!
im

相關文章
相關標籤/搜索