How do I get graphics library working in ubuntu?

Viewed 89

I can't get my graphics library to work in my code. I use the ubuntu app. Here is some example code and its output:

The code:

from graphics import *

circ = Circle(50)
circ.set_color(Color.red)
circ.set_position(80,120)
add(circ)

The output:

Traceback (most recent call last):
  File "ewfrew.py", line 1, in <module>
    from graphics import *
  File "/home/adam/.local/lib/python3.8/site-packages/graphics.py", line 185, in <module>
    _root = tk.Tk()
  File "/usr/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

I think it's an issue with the graphics library I installed because it says line 185, but I'm not sure.

0 Answers
Related