Search code examples
pythonpython-3.xopenai-gym

Impossible to create an environment with a specific game (gym retro)


I'm trying to create a game environement in pyhton 3.6.8 using gym-retro. It's a stable game name SpaceInvaders-Atari2600 located in "..retro\data\stable\"

The basic command is :

env = retro.make(game='SpaceInvaders-Atari2600')

but that isn't working for me and i got the error :

raise FileNotFoundError('Game not found: %s. Did you make sure to import the ROM?' % game) FileNotFoundError: Game not found: SpaceInvaders-Atari2600. Did you make sure to import the ROM?

But the problem is that the ROM is here, in the folder SpaceInvaders-Atari2600 there is a file named "rom.sha"


import gym
import retro    

#Environment creation
env = retro.make(game='SpaceInvaders-Atari2600');
# don't work for me ...

# when i try this : 

for game in retro.data.list_games():
   print(game)

# I see the game SpaceInvaders-Atari2600

I'm desperated please if someone got an idea on how to create this environement...

I'm totally new on python i never used it before this week, i have to use this language to test Q-learning training for a neural network so i can do stupid mistakes with syntaxe


Solution

  • Ok i found the solutiuon, the ROM file i downloaded before wasn't valid that's all

    If someone is following the same tuto as me, just to help him a valid rom is findable at this adresse :

    https://www.gametronik.com/site/fiche/atari_2600/Space%2520Invaders/