ImportError: libtk8.6.so: cannot open shared object file: No such file or directory

All you need to do is to install the tkinter package. Now universal precompiled packages such as ActivePython will not work, well at least it didn't work for me. I don't know if this problem occurs in other OSes but I know the solution for Linux: Install the Tk package from the terminal.

In Arch, Tk is available in the Arch repository. You don't need aur for this, just type on the terminal:

sudo pacman -S tk

If you are on another Linux distro such as Debian or a Debian based distro you will probably have to find a PPA repository online and in Debian based distros just type on the terminal:

sudo apt-get install tk

Which applies to all distros.


I'm on Manjaro, use Gnome3 on Wayland. After installed tk I got an error about Xorg. So I use Google, and found I need to install python-pygubu from Visual editor for creating GUI in Python 3 tkinter.

And then another error like: Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine". Also found a solution, to install gtk-engine-murrine form that link.


Install tk through command line

sudo pacman -S tk
sudo apt-get install tk

depending on your OS. It will work.

import tk

or

import turtle  # (turtle uses tk as a dependancy)

reproduces the error.

Also doing pip install does not removes the error. So you must install tk through your package manager like mentioned above.