L
L
link_vrb2021-06-27 18:47:19
Python
link_vrb, 2021-06-27 18:47:19

How to import tkinter python module?

I ran a program with an imported tkinter library but got an error:
from tkinter import *
ModuleNotFoundError: No module named 'tkinter'
I have python 3.6 and latest version of pip . I already have the tkinter module installed:
pip install tk-tools
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: tk-tools in /home/link/.local/lib/python3.6/site-packages ( 0.14.0)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Endora Blackwell, 2021-06-27
@link_vrb

If you have an OS of the Linux family (As I look at the home directory), then below.
If Windows, then it is desirable to install Python above already.
Try using commands:

sudo apt-get install python3-tk 
sudo apt-get install python3.6-tk
sudo dnf install python3-tkinter

And at the very least it can help: sudo apt-get install python3.7-tk
And so I advise you to update the version of python

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question