Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am trying to add a GUI input box and I found out that the way you do that is by using a module called tkinter. While I was trying to install it on my arch linux machine through the ActivePython package I got the following error:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.6/tkinter/__init__.py", line 36, in <module> import _tkinter # If this fails your Python may not be configured for Tk ImportError: libtk8.6.so: cannot open shared object file: No such file or directory  shell returned 1\ 
like image 937
KnownAsDon Avatar asked Jan 29 '18 15:01

KnownAsDon


1 Answers

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.

like image 105
KnownAsDon Avatar answered Sep 23 '22 04:09

KnownAsDon