Python error ImportError No module named tkinter please install the python-tk package

501    Asked by Ayushigupta in Python , Asked on Jul 26, 2021

I am trying to install python on Linux and I am getting the following error:

ImportError: No module named _tkinter, please install the python-tk package.

How do I install tkinter on Linux?

Answered by Benjamin Moore

  • You are getting this error “please install the python-tk package” because you have not installed tkinter locally. You can run the install command to download and install tkinter. 
  • Use the following command to install tkinter on Linux: apt-get install python-tk  It's a little complicated to install it on the local system using the package based method. Using apt-get is the easiest way.



Your Answer

Interviews

Parent Categories