Python Forum
[Tkinter] Tkinter wouldn't work with python3.8.3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Tkinter wouldn't work with python3.8.3
#1
Hi, I am new to python and Tkinter, I have a very simple code to run see if everything works.

But it seems that it only works with the default python MacBook has, which is Python 2.7
When I try to run it with python 3.8 it only pops out a blank window with a black background.

Here is my code:
import tkinter as tk
window = tk.Tk()
greeting = tk.Label(text="Hello, Tkinter")
greeting.pack()
window.mainloop()
Does anyone know why I am having this problem?
Thanks in advance
Reply
#2
You probably do not have tkinter installed for python3.8
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply
#3
first see which version of python you are running
from command line: python -V
If it's not python3, try: python3 -V

if neither is python 3, you either don't have it installed, or it's not in you path or environment.
if one shows python 3, using that one, from command line type: python or python3
you shoud be in interactive python. type: import tkinter
if it returns without error, then tkinter is available.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] ttk-->treeview-->tag_configure() not work over Python3.6 hqbfljx 10 8,398 Jul-04-2022, 02:40 PM
Last Post: jojyjoseph
  Python3 tkinter radiobutton problem Nick_tkinter 14 6,011 Feb-15-2021, 11:01 PM
Last Post: Nick_tkinter
  Call local variable of previous function from another function with Python3 & tkinter Hannibal 5 4,427 Oct-12-2020, 09:16 PM
Last Post: deanhystad
  [Tkinter] Scrollbar doesn't work on Canvas in Tkinter DeanAseraf1 3 9,358 Sep-19-2019, 03:26 PM
Last Post: joe_momma
  [Tkinter] createing a tkinter photoimage from array in python3 pootle 2 16,809 Oct-18-2016, 09:28 AM
Last Post: pootle

Forum Jump:

User Panel Messages

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