You can't install tkinter using pip because tkinter is an interface to a C++ library called Tk, whereas pip is coded with Python.
Luckily you do not have to worry about the above statement because tkinter comes as a built-in library for the standard Python distribution.
So what you have to do is:
- Go to your virtualenv directory:
cd to_your_virtualenv_directory
- Activate it:
source bin/activate
- Access your python shell within it:
python
- Then
import tkinter as tk
Note:
Depending on your settings, maybe when you type python
you will notice you are prompted to work with Python 2.x instead. In that case, just type this: import Tkinter as Tk
. If, however, typing python
leads you to use Python 3.x (as I set it on my machine), but you prefer to work with Python 2.x then simply type python2
instead of python
.