Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in importing environment OpenAI Gym

I am trying to run an OpenAI Gym environment however I get the following error:

import gym
env = gym.make('Breakout-v0')

ERROR

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ale_py/gym/environment.py:11: DeprecationWarning: Importing atari-py roms won't be supported in future releases of ale-py.
  import ale_py.roms as roms
A.L.E: Arcade Learning Environment (version +a54a328)
[Powered by Stella]
Traceback (most recent call last):
  File "/Users/username/Desktop/OpenAI Gym Stuff/OpenAI_Exp.py", line 2, in <module>
    env = gym.make('Breakout-v0')
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/gym/envs/registration.py", line 200, in make
    return registry.make(id, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/gym/envs/registration.py", line 105, in make
    env = spec.make(**kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/gym/envs/registration.py", line 75, in make
    env = cls(**_kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ale_py/gym/environment.py", line 123, in __init__
    self.seed()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ale_py/gym/environment.py", line 171, in seed
    raise error.Error(
gym.error.Error: Unable to find game "Breakout", did you import Breakout with ale-import-roms?
like image 834
gapansi99 Avatar asked Nov 06 '22 00:11

gapansi99


2 Answers

This worked for me via terminal:

pip install gym[atari]
pip install autorom[accept-rom-license]

After installing gym, it is 80 games. After installing gym[atari], it is 267 games. And you have to accept the specific licenses to activate additional games.

like image 29
Otvazhnii Avatar answered Nov 14 '22 23:11

Otvazhnii


pip install gym[atari,accept-rom-license]==0.21.0
like image 156
Rexcirus Avatar answered Nov 14 '22 22:11

Rexcirus