Skip to content
Sign upLog in
← Back to Community
Error on Turtle
Profile icon
cp22e

Hi. Pls help.
I got this error.
Below is the code and result:

Code:
import turtle

turtle = turtle.Turtle()
turtle.forward(90)

Result:
Traceback (most recent call last):
File "main.py", line 3, in
turtle = turtle.Turtle()
File "/usr/local/lib/python3.7/turtle.py", line 3812, in init
Turtle._screen = Screen()
File "/usr/local/lib/python3.7/turtle.py", line 3662, in Screen
Turtle._screen = _Screen()
File "/usr/local/lib/python3.7/turtle.py", line 3678, in init
_Screen._root = self._root = _Root()
File "/usr/local/lib/python3.7/turtle.py", line 434, in init
TK.Tk.init(self)
File "/usr/local/lib/python3.7/tkinter/init.py", line 2023, in init
self.tk = _tkinter.create(screenName, baseName, className,interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environmentvariable

KeyboardInterrupt

Voters
Profile icon
cp22e
Comments
hotnewtop
Profile icon
SixBeeps

You need to set your repl's language to "Python with Turtle" instead of "Python"

Profile icon
Secretcoder101

I do this
import turtle
wn = turtle.Screen()
turtle.forward(0)