Python Forum
tkinter installation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tkinter installation

I failed installing tkinter
python -m pip install tkinter
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none)
ERROR: No matching distribution found for tkinter
What shall I do ?

I tried it too and got the same error message. Anyway, import tkinter is not a problem in the Python shell in my case. Have you already tried to import the module? It may be already installed.
  • which OS do you use?
  • which Python version do you use?

is automatically installed with most python versions
try simple app:
import tkinter as tk

def simple_app(parent):
   parent.title("It's alive!")

if __name__ == '__main__':
    root = tk.Tk()
Hi Larz60+

The OS is Ubuntu 16.04, and Python : 3.8.0 (I'll include this information into my signature)

Before asking for help, I tried
>>> import tkinter Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'tkinter' Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/", line 63, in apport_excepthook from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python3/dist-packages/apport/", line 5, in <module> from import Report File "/usr/lib/python3/dist-packages/apport/", line 30, in <module> import apport.fileutils File "/usr/lib/python3/dist-packages/apport/", line 23, in <module> from apport.packaging_impl import impl as packaging File "/usr/lib/python3/dist-packages/apport/", line 24, in <module> import apt File "/usr/lib/python3/dist-packages/apt/", line 23, in <module> import apt_pkg ModuleNotFoundError: No module named 'apt_pkg' Original exception was: Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'tkinter'
tkinter is included with python 3.8.
make sure environment variables are set correctly, run:
python -V
do you see python 3.8?
remi@remi-Vostro-3550:~$ python -V
Python 3.8.0
remi@remi-Vostro-3550:~$ python
Python 3.8.0 (default, Oct 28 2019, 16:14:01) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/remi/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']
>>> exit()
remi@remi-Vostro-3550:~$ for rep in '/usr/lib/' '/usr/lib/python3.8' '/usr/lib/python3.8/lib-dynload' '/home/remi/.local/lib/python3.8/site-packages' '/usr/local/lib/python3.8/dist-packages' '/usr/lib/python3/dist-packages'; do  echo "${rep}"; ls -1 "${rep}" | grep tk; done
ls: impossible d'accéder à '/usr/lib/': Aucun fichier ou dossier de ce type
So, should I reinstall Python ?

reinstall seems like a viable option.
follow snippsat's guide here:
Hi Larz60+

Reinstalling Python was not exactly the best option. In fact, on Unix-like systems, tkinter is not included in Python, but through Python's extensions. I got aware of this after having reinstalled Python-3.8.2, and failed.

The way to go is explained the Python Developer's Guide.
glad to hear all is well.

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020