10

So I posted this error on a Facebook group, they said I should get pip. I installed pip, when I am wanting to install tkinter it's giving me error:

I used this command first :

sudo pip install tkinter

.
.
.
error:

ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none)
ERROR: No matching distribution found for tkinter
halfer
  • 19,824
  • 17
  • 99
  • 186
AndiiCodes
  • 113
  • 1
  • 1
  • 5

3 Answers3

25

After a day of headache, this worked for me:

$ brew install python-tk
subtleseeker
  • 4,415
  • 5
  • 29
  • 41
9

tkinter is part of the standard library. You don't need to install it. You can import it with import tkinter.

Josh Clark
  • 964
  • 1
  • 9
  • 17
0

I've had the same issue:

ModuleNotFoundError: No module named 'tkinter'

After quite a while I finally realized that I needed to install the python-tk package. On Linux all I needed to do was sudo apt-get install python3-tk.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Ugly
  • 9
  • 2
  • Is that the exact error you received? From looking at https://askubuntu.com/questions/815874/importerror-no-named-tkinter-please-install-the-python3-tk-package, I would expect the more specific one. – AMC Apr 23 '20 at 21:59
  • That's the exact error I received from python when attempting to run: `import tkinter` – Ugly Apr 24 '20 at 12:27
  • Unfortunately, this question is about macOS, not Linux, so this answer is not really relevant. – mhucka Jul 12 '22 at 02:25