Closed zplizzi closed 1 year ago
I updated gym
and that error went away, but now I get this output and the pygame window is just a black screen with a spinny mouse cursor:
% python gui/run_gui.py 130 ↵
Creating environment: memory_maze:MemoryMaze-9x9-v0
2023-01-13 13:24:30.868 Python[32096:4819747] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/k5/5485r0sj18vbkvttgzy37rkh0000gn/T/org.python.python.savedState
Observation space: Box(0, 255, (64, 64, 3), uint8)
Action space: Discrete(6)
WARNING:absl:Cannot set velocity on Entity with no free joint.
The dependencies are mentioned in the README:
# GUI dependencies
pip install gym pygame pillow imageio
But it seems you have figured that out already. I'm not sure what to make of the black frozen screen. The console logs don't indicate any problem, the WARNING is normal.
Yep it would be helpful if you specified the correct versions of those packages.
For some reason the code related to the fonts was causing the black screen issue - not sure why. I'm using pygame 2.1.2.
I changed the font-related lines to:
font = pygame.font.Font(None, 16)
fontsmall = pygame.font.Font(None, 12)
text_surface = font.render(line, True, (255, 255, 255))
screen.blit(text_surface, (16, y))
y += font.size(line)[1] + 2 # type: ignore
text_surface = fontsmall.render(line, True, (255, 255, 255))
screen.blit(text_surface, (render_size[0] + PANEL_LEFT + 16, y))
y += fontsmall.size(line)[1] + 2 # type: ignore
and it's working now.
Can you list the versions of required packages that you used or know work? When I try to run the GUI demo on mac python 3.9.2, I get this error, which I assume is because I have an incompatible version: