unable to install/import tkinter
Try this:
sudo apt-get install python-tk
or, since your question is tagged as python3, this:
sudo apt-get install python3-tk
python-tk
cannot be installed using pip.
As tk is TkInter (-> Interface to TK, which is written in C(++) ) you need to install the C(++) Library TK.
you cannot install this library using pip
, as pip
is designed to install (mainly)[1]pure python packages. By the way you would not have the sufficient rights to install the library. So you need to ask your superuser for help.
The only way to install it is using
sudo apt-get install python-tk # python2
or
sudo apt-get install python3-tk #python3
And last but not least you would have to use pip3
to install packages for python3
.
It is the same as you cannot install freetype
using pip
.
Note: it is better to use python3 -m pip
instead of pip3
, as there might be multiple python3
installations on your machine (e.g. python3.4
and python3.5.1
)
[1]: Actually pip is able to compile C/C++ Libraries, but it does not seem like it is able to install System-Libraries. Or one will create this package in future.