Home > python, ubuntu > “import tkinter” fails

“import tkinter” fails

Under Manjaro I wanted to use the turtle module but I got this error:

File "square.py", line 1, in <module>
    import turtle
  File "/usr/lib/python2.7/lib-tk/turtle.py", line 107, in <module>
    import Tkinter as TK
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 39, 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


sudo pacman -S tk

Ubuntu 14.04
I had the same problem under Ubuntu when I tried to use matplotlib on a remote server.

sudo apt install python3-tk
Categories: python, ubuntu Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: