Skip to content
Sign upLog in
← Back to Community

turtle library is not working

Profile icon
rampalan

My code is below:
import turtle
b=turtle.Turtle()
b.forward(100)

Error below:
Traceback (most recent call last):
File "main.py", line 2, in
r_turtle = turtle.Turtle()
File "/usr/local/lib/python3.8/turtle.py", line 3812, in init
Turtle._screen = Screen()
File "/usr/local/lib/python3.8/turtle.py", line 3662, in Screen
Turtle._screen = _Screen()
File "/usr/local/lib/python3.8/turtle.py", line 3678, in init
_Screen._root = self._root = _Root()
File "/usr/local/lib/python3.8/turtle.py", line 434, in init
TK.Tk.init(self)
File "/usr/local/lib/python3.8/tkinter/init.py", line 2261, 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
GorkemTuran
Profile icon
rampalan
Comments
hotnewtop
Profile icon
SixBeeps

Python with Turtle is its own language option on Repl.it