{"id":1063,"hash":"6b13f63d0da0874720c59909df3001f4fac603b122fb7faa0498c8b7b85d5992","pattern":"matplotlib error - no module named tkinter","full_message":"I tried to use the matplotlib package via Pycharm IDE on windows 10.\nwhen I run this code:\n\nfrom matplotlib import pyplot\n\nI get the following error:\n\nImportError: No module named 'tkinter'\n\nI know that in python 2.x it was called Tkinter, but that is not the problem - I just installed a brand new python 3.5.1.\n\nEDIT: in addition, I also tried to import 'tkinter' and 'Tkinter' - neither of these worked (both returned the error message I mentioned).","ecosystem":"pypi","package_name":"matplotlib","package_version":null,"solution":"For Linux\nDebian based distros:\n\nsudo apt-get install python3-tk\n\nRPM based distros:\n\nsudo yum install python3-tkinter\n\nFor windows:\nFor 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 . Good python distributions for Windows can be found by the companies Anaconda or ActiveState.\n\nTest the python module\npython -c \"import tkinter\"\n\np.s. I suggest installing ipython, which provides powerful shell and necessary packages as well.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/36327134/matplotlib-error-no-module-named-tkinter","votes":229,"created_at":"2026-04-19T04:52:15.479504+00:00","updated_at":"2026-04-19T04:52:15.479504+00:00"}