40
votes

I am having a problem during the installation of tkinter. I have version 2.7.11. I entered the pip install tkinter on dos but it shows the following message:

collecting tkinter

Could not find a version that satisfies the requirement tkinter (from versions:) No matching distribution found for tkinter

I have successfully installed flask with the same procedure, but for tkinter it is showing problem. How can I get rid of this problem?

14
Where did you get Python? The standard distribution includes Tcl and Tkinter. - TigerhawkT3
Does 'on dos' mean Windows? If you want answers, answer Tigerhawk's question. - Terry Jan Reedy

14 Answers

22
votes

The Tkinter library comes in default with every Python installation

Try this:

import Tkinter as tk
33
votes

You should install

apt-get install python-tk

This should solve your issue

3
votes

Follow this guide to install "tkinter". However now with Python version 3.1 onwards, it is part of the standard python distribution.

You can also install it using sudo apt-get install python3-tk-dbg, if you are in virtualenv. (Same can be done for normal installation, not just virtualenv)

2
votes

import Tkinter as tk

Python 3 changed tkinter (from python 2.7) to Tkinter

1
votes

to find your package run:

sudo yum search python|grep tk

mine was:

yum install python3-tkinter.x86_64

1
votes

I was able to fix this on Amazon Linux 2 with python2.7 by running this sudo yum install python-tools -y command.

1
votes

On a MacBook use brew install python-tk

The error will be sorted out.

1
votes

This just has to do with the version changes

python 2.x: import tkinter as tk

python 3.x: import Tkinter as tk

1
votes

import Tkinter as tk

Notice the T. This was changed in python 3.x

0
votes

I had to install python3-tk manually before it worked (via apt-get)

0
votes

the below answer in for Windows:

after installing Tk in your windows machine by following the instructions mentioned in the following link (https://tkdocs.com/tutorial/install.html#installwin), import tkinter as tk (for python3) or import Tkinter as tk (for python2). FYI - 'Tkinter' has been renamed as 'tkinter' in python3. It worked well for me.

0
votes

pip shown Could not find a version that satisfies the requirement python--tkinter (from versions: ) No matching distribution found for python--tkinter You are using pip version 10.0.1, however version 19.0.3 is available. You should consider upgrading via the python -m pip install --upgrade pip command.

0
votes

This will work for tkinter installment

pip install tk
python -m pip install tk
0
votes

just go on cmd and type pip intall Tk interface, i thinks this is the full true name of tkinter module