3

I use pip install python-tk but have an error ERROR: Could not find a version that satisfies the requirement python-tk (from versions: none) ERROR: No matching distribution found for python-tk

Duy_DEV_GenZ
  • 61
  • 1
  • 1
  • 2

3 Answers3

8

Tkinter isn't distributed through pip; if it didn't come pre-packaged with Python, you have to get it from elsewhere:

  • Ubuntu
sudo apt-get install python3-tk 
  • Fedora
sudo dnf install python3-tkinter
  • MacOS
brew install python-tk
Antoine
  • 1,393
  • 4
  • 20
  • 26
Voxel
  • 95
  • 2
  • 9
1

For Windows, check this checkbox during setup.

enter image description here

товіаѕ
  • 2,881
  • 4
  • 23
  • 53
-6

Firstly Make sure Python and pip is preinstalled on your system. Type the following commands in command prompt to check is python and pip is installed on your system.

To check Python:

python --version

If python is successfully installed, the version of python installed on your system will be displayed.

To check pip

pip -V

The version of pip will be displayed, if it is successfully installed on your system.

Now Install Tkinter

Tkinter can be installed using pip. The following command is run in the command prompt to install Tkinter.

pip install tk

This command will start downloading and installing packages related to the Tkinter library. Once done, the message of successful installation will be displayed.

user12256545
  • 2,755
  • 4
  • 14
  • 28