Ask coding questions

← Back to all posts
Tkinter in python
UmerkkkKhan

Hii!! I want to run Tkinter in Python on live(repl.it), but when i write
" from tkinter import * " and its come with following error :

 Traceback (most recent call last):
File "main.py", line 3, in <module>
root = Tk()
File "/usr/local/lib/python3.6/tkinter/init.py", line 2017, in init
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

Voters
yoonsu
CybearTron
07AjinkyaAjinky
DevilStudio27
917
ShashikalaShilw
Yahya2932
KatyaBatres
magoslea000
SasanMehmandoos
Comments
hotnewtop
LD1

All you have to do is when you select your language, select Tkinter instead of python.

MakashiCF

@LD1 Thank you, God.

HappyFakeboulde

The error message is basically a fancy way of the interpreter saying that tkinter doesn't work on repl.it.

UmerkkkKhan

@HappyFakeboulde Thanks Brother

HappyFakeboulde

@UmerkkkKhan I'm not your male sibling but okay

StringentDev

@HappyFakeboulde so how come it works for me?

HappyFakeboulde

@Lethdev2019 because you're using the explicit tkinter repl type instead of normal python
when the repl.it developers added support for tkinter, they made it a separate type of repl, which you might have selected

THEDK
ZAIDISLAMBINRUD

actually the error that you get is basically saying to code the tkinter window

IsaacPancakes1

it says Hello wold in the default window (:

PeterChaplin_Sm

When making a repl.it, select TKinter rather than Python.
It is python.

Geocube101

I don't believe TKinter is supported in repl.it yet.

UmerkkkKhan

@Geocube101 thanks brother