Home > Software design >  Can not use tkinter even I already install
Can not use tkinter even I already install

Time:03-17

I am trying to build a UI for desktop application. And I use tkinter for UI. I install tkinter using pip

pip install tk

It show me that I successfully install tkinter

Downloading tk-0.1.0-py3-none-any.whl (3.9 kB)
Installing collected packages: tk
Successfully installed tk-0.1.0
WARNING: You are using pip version 21.1.2; however, version 21.3.1 is available.
You should consider upgrading via the '/home/navin/voice-transform/test_dir/venv/bin/python -m pip install --upgrade pip' command.

But when I try to use it I'm not able to use the library

Traceback (most recent call last):
  File "me.py", line 1, in <module>
    from tkinter import *
ModuleNotFoundError: No module named 'tkinter'

CodePudding user response:

If you use a Linux distrubion like Ubuntu then you have to use the apt command

sudo apt install python3-tk

If you use Widows then you have to use the executable they provide on their website. Look at this answer

CodePudding user response:

pip install tk installs the tensorkit package, not tkinter. You cannot install tkinter with pip.

  • Related