Skip to content
← Back to Community
Tkinter in python
Profile icon
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
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
Profile icon
TEO-XIN-LONGXIN
Profile icon
yoonsu
Profile icon
CybearTron
Profile icon
07AjinkyaAjinky
Profile icon
DevilStudio27
Profile icon
917
Profile icon
ShashikalaShilw
Profile icon
Yahya2932
Profile icon
KatyaBatres
Profile icon
magoslea000
Comments
hotnewtop
Profile icon
CircuitSacul

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

Screen Shot 2020-02-08 at 6.44.13 PM

Profile icon
MakashiCF

@LD1 Thank you, God.

Profile icon
HappyFakeboulde

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

Profile icon
UmerkkkKhan

@HappyFakeboulde Thanks Brother

Profile icon
HappyFakeboulde

@UmerkkkKhan I'm not your male sibling but okay

Profile icon
[deleted]
Profile icon
StringentDev

@HappyFakeboulde so how come it works for me?

Profile icon
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

Profile icon
THEDK
Profile icon
RenjieChen

@HappyFakeboulde would normal python functions still work if i have it as tkinter?

Profile icon
IbrahimSaeed1

Select tkinter templet instead of python templet.

Profile icon
ZAIDISLAMBINRUD

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

Profile icon
IsaacPancakes1

it says Hello wold in the default window (:

Profile icon
PeterChaplin_Sm

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

Profile icon
Geocube101

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

Profile icon
UmerkkkKhan

@Geocube101 thanks brother