Skip to content
Sign upLog in
← Back to Community
my code does not work
Profile icon
StevenJang

Python

import turtle
T = turtle.Turtle()
T.forward(100)

Resulted in...

Traceback (most recent call last):
File "main.py", line 2, in
T = 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 environment variable

Voters
Profile icon
StevenJang
Comments
hotnewtop
Profile icon
ArjunSS1

You have to choose the python + turtle repl language to use turtle not just python

Profile icon
Secretcoder101

no