Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Issues with tKinter

This is my first time ever writing here.
Also my first time actually coding.

I’ve made a code but have issues running it due to tKinter not seeming to exist, even though I’ve specifically installed python from the official webpage and also ticked the tcl/tk options.

When trying to launch my code i get this error:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

File "C:\Users\Nikla\Desktop\roligttest.py", line 44, in
exp_bar = tk.Progressbar(exp_frame, orient=tk.HORIZONTAL, length=200, mode=’determinate’, value=20, maximum=100)
AttributeError: module ‘tkinter’ has no attribute ‘Progressbar’


This error then leads me to investigating if tkinter is installed correctly. But to my surprise I get this message:

PS C:\Users\Nikla> pip uninstall tkinter
WARNING: Skipping tkinter as it is not installed.
PS C:\Users\Nikla> 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


Any ideas?

And keep in mind, this is my ABSOLUTE first time trying to code something.

Thanks in advance,
Niklas

I tried reinstalling tkinter, it did not exist
I tried uninstalling tkinter, it did not exist
I tried installing tkinter, it tells me "Defaulting to user installation because normal site-packages is not writable

I also get "ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none)
ERROR: No matching distribution found for tkinter"-message.

>Solution :

Just use the tkk package.

from tkinter import ttk

pb = tkk.Progressbar(exp_frame, orient=tk.HORIZONTAL, length=200, mode='determinate', value=20, maximum=100)

Reference

Also tkinter is a built in package and can’t remove

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading