Ask coding questions

← Back to all posts
Importing graphics.py
sienaciz (4)

Hello! I have a code for a Tetris game that I made at a summer program, but I need to import graphics (from graphics import ) so I can use it on my own computer. I've tried uploading the graphics.py file into main.py as well as in another folder, and I've tried using the requirements.txt thing too. I keep getting errors that say either 3 things: "no module named graphics," "could not find a version that satisfies the requirement graphics (from versions: )," or "File "main.py", line 7, in <module>
from graphics import

File "/home/runner/graphics.py", line 174, in <module>
_root = tk.Tk()
File "/usr/local/lib/python2.7/lib-tk/Tkinter.py", line 1819, 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'm using the graphics.py simple object oriented graphics library version 5.0 by John Zelle, if that helps.

Please help!! I really want to run my code!

Comments
hotnewtop
mat1 (4424)

Please upvote this comment if it was helpful or useful in any way
Repl.it currently doesn't have GUI support. However, you could use Python Turtle to display stuff

ash15khng (712)

Hi, repl.it currently does not have GUI support yet, so trying to use any GUI libraries will not work.