Resolve the error raise importerror, str (MSG) + ‘, please install the python TK package’ (valid for personal testing)

Solve the following similar error reports:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in <module>
    raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: /usr/lib/libtk8.5.so.0: invalid ELF header, please install the python-tk package

terms of settlement:

It appears that the library is corrupted
try sudo apt get remove Python TK ,
then sudo apt get clean download the package again,
sudo apt get install Python TK and then try importing again
this problem is resolved.

Another possibility is that you somehow messed up your apt/sources. List, and you installed a library for the wrong platform.

Reference link:
https://stackoverflow.com/questions/11043844/python-tk-package-not-recognized-in-python-2-7-3

Read More: