Retro Games in Gym

Overview

Status: Maintenance (expect bug fixes and minor updates)

Gym Retro

Gym Retro lets you turn classic video games into Gym environments for reinforcement learning and comes with integrations for ~1000 games. It uses various emulators that support the Libretro API, making it fairly easy to add new emulators.

Supported platforms:

  • Windows 7, 8, 10
  • macOS 10.13 (High Sierra), 10.14 (Mojave)
  • Linux (manylinux1)

CPU with SSSE3 or better

Supported Pythons:

  • 3.6
  • 3.7
  • 3.8

Each game integration has files listing memory locations for in-game variables, reward functions based on those variables, episode end conditions, savestates at the beginning of levels and a file containing hashes of ROMs that work with these files.

Please note that ROMs are not included and you must obtain them yourself. Most ROM hashes are sourced from their respective No-Intro SHA-1 sums.

Documentation

Documentation is available at https://retro.readthedocs.io/en/latest/

You should probably start with the Getting Started Guide.

Contributing

See CONTRIBUTING.md

Changelog

See CHANGES.md

Emulated Systems

  • Atari
    • Atari2600 (via Stella)
  • NEC
    • TurboGrafx-16/PC Engine (via Mednafen/Beetle PCE Fast)
  • Nintendo
    • Game Boy/Game Boy Color (via gambatte)
    • Game Boy Advance (via mGBA)
    • Nintendo Entertainment System (via FCEUmm)
    • Super Nintendo Entertainment System (via Snes9x)
  • Sega
    • GameGear (via Genesis Plus GX)
    • Genesis/Mega Drive (via Genesis Plus GX)
    • Master System (via Genesis Plus GX)

See LICENSES.md for information on the licenses of the individual cores.

Included ROMs

The following non-commercial ROMs are included with Gym Retro for testing purposes:

Citation

Please cite using the following BibTeX entry:

@article{nichol2018retro,
  title={Gotta Learn Fast: A New Benchmark for Generalization in RL},
  author={Nichol, Alex and Pfau, Vicki and Hesse, Christopher and Klimov, Oleg and Schulman, John},
  journal={arXiv preprint arXiv:1804.03720},
  year={2018}
}
Comments
  • Importing Atari Games with python -m retro.import

    Importing Atari Games with python -m retro.import

    Issue summary

    Hello, 😄

    I want to import Atari Space Invaders rom to retro. My rom name is "SpaceInvaders-Atari2600.a26" the same name as presented in the list of possible roms playable in retro and the correct format (.a26)

    However, when I want to import this rom to my retro environment using python -m retro.import. I receive this message:

    Importing 1 potential games...
    Imported 0 games
    
    

    So I tried to import it manually in Anaconda3\envs\gameplai\Lib\site-packages\retro\data\SpaceInvaders-Atari2600 by copy and paste the rom.

    But it didn't work:

    FileNotFoundError: Game not found: SpaceInvaders-Atari2600. Did you make sure to import the ROM?

    Do you know what should I do to fix this? I have only this problem when I try to import Atari games

    Again, this new library is awesome thanks for your work! 👏👏👏

    System information

    • Windows 10
    • Python 3.6.4
    • Retro 0.5.3
    opened by simoninithomas 35
  • Installation failed in windows 7

    Installation failed in windows 7

    Issue summary

    after cloning the repo and then want to install it(this section https://github.com/openai/retro#install-from-source) I get this error:

    Obtaining file:///C:/Users/Farshid/gym-retro Requirement already satisfied: gym in c:\users\farshid\appdata\local\programs\py thon\python36\lib\site-packages (from gym-retro==0.5.4.dev9+gda18b9d) Requirement already satisfied: numpy>=1.10.4 in c:\users\farshid\appdata\local\p rograms\python\python36\lib\site-packages (from gym->gym-retro==0.5.4.dev9+gda18 b9d) Requirement already satisfied: requests>=2.0 in c:\users\farshid\appdata\local\p rograms\python\python36\lib\site-packages (from gym->gym-retro==0.5.4.dev9+gda18 b9d) Requirement already satisfied: six in c:\users\farshid\appdata\local\programs\py thon\python36\lib\site-packages (from gym->gym-retro==0.5.4.dev9+gda18b9d) Requirement already satisfied: pyglet>=1.2.0 in c:\users\farshid\appdata\local\p rograms\python\python36\lib\site-packages (from gym->gym-retro==0.5.4.dev9+gda18 b9d) Requirement already satisfied: urllib3<1.23,>=1.21.1 in c:\users\farshid\appdata \local\programs\python\python36\lib\site-packages (from requests>=2.0->gym->gym- retro==0.5.4.dev9+gda18b9d) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\farshid\appdata \local\programs\python\python36\lib\site-packages (from requests>=2.0->gym->gym- retro==0.5.4.dev9+gda18b9d) Requirement already satisfied: certifi>=2017.4.17 in c:\users\farshid\appdata\lo cal\programs\python\python36\lib\site-packages (from requests>=2.0->gym->gym-ret ro==0.5.4.dev9+gda18b9d) Requirement already satisfied: idna<2.7,>=2.5 in c:\users\farshid\appdata\local
    programs\python\python36\lib\site-packages (from requests>=2.0->gym->gym-retro== 0.5.4.dev9+gda18b9d) Requirement already satisfied: future in c:\users\farshid\appdata\local\programs \python\python36\lib\site-packages (from pyglet>=1.2.0->gym->gym-retro==0.5.4.de v9+gda18b9d) Installing collected packages: gym-retro Found existing installation: gym-retro 0.5.3 Uninstalling gym-retro-0.5.3: Successfully uninstalled gym-retro-0.5.3 Running setup.py develop for gym-retro Complete output from command c:\users\farshid\appdata\local\programs\python
    python36\python.exe -c "import setuptools, tokenize;file='C:\Users\Farshid \gym-retro\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read() .replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" develop --no-deps: running develop running egg_info writing gym_retro.egg-info\PKG-INFO writing dependency_links to gym_retro.egg-info\dependency_links.txt writing requirements to gym_retro.egg-info\requires.txt writing top-level names to gym_retro.egg-info\top_level.txt package init file 'data_init_.py' not found (or not a regular file) reading manifest template 'MANIFEST.in' warning: no previously-included files matching '.o' found anywhere in distr ibution warning: no previously-included files matching '.a' found anywhere in distr ibution warning: no previously-included files matching '.dylib' found anywhere in d istribution warning: no previously-included files matching '.so' found anywhere in dist ribution warning: no previously-included files matching '*-version' found under direc tory 'retro\cores' writing manifest file 'gym_retro.egg-info\SOURCES.txt' running build_ext error: [WinError 2] The system cannot find the file specified

    ----------------------------------------
    

    Rolling back uninstall of gym-retro Command "c:\users\farshid\appdata\local\programs\python\python36\python.exe -c " import setuptools, tokenize;file='C:\Users\Farshid\gym-retro\setup.py';f =getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f .close();exec(compile(code, file, 'exec'))" develop --no-deps" failed with e rror code 1 in C:\Users\Farshid\gym-retro\

    System information

    • Windows 7
    • Python 3.6.5
    • gym-retro 0.5.4
    opened by FarshidShekari 31
  • Could not find Makefile+Call Stack (most recent call first):   CMakeLists.txt:151 (add_core)

    Could not find Makefile+Call Stack (most recent call first): CMakeLists.txt:151 (add_core)

    Issue summary

    I tried many times to build [retro] through CMake, but the error is keep showing up. I don't know how to fix them. image

    image

    [Put a detailed description of the issue here.]

    System information

    • [Gym Retro version]: the newest
    opened by reginalluna 23
  • Cannot Render Env

    Cannot Render Env

    Issue summary

    I just wanted to test the streetfighter genesis ROM and I am able to create an environment out of the ROM. If I try to render it or plot the state it looks like this: emulator

    However if I try to open the ROM inside the UI-Integration it works out of the box.

    Do you have any ideas why this happens?

    System information

    • Ubuntu 18.04
    • Python 3.7 (in conda environment)
    • Gym Retro 0.6.0.dev45+g5af5926
    opened by justusschock 16
  • Instructions for Adding New Games/States

    Instructions for Adding New Games/States

    Issue summary

    There is no documentation that I can find that explains how to add new games or new states.

    By copying the site-packages/retro/data/SonicTheHedgehog-Genesis folder structure with a different ROM, I can get that ROM to show up as a game choice in retro.

    The README file in this repo explains that states are just emulator states, but gzipped. But when I use Genesis Plus GX to save state and then gzip and copy that state into the folder I created above, the state can get loaded but it does not seem to work.

    For example, when using SonicTheHedgehog-Genesis and saving a state in the GreenHillZone-Act1 stage, and then gzipping and putting that state into the SonicTheHedgehog-Genesis folder, I can load the state, but an agent cannot seem to control it.

    Details on the emulator core used (and version) and steps taken to produce a working state file would be much appreciated for those trying to add new games or states to retro.

    System information

    • OS: Windows 10
    • Python version: 3.6
    • Gym Retro version: 0.5.4
    opened by MaxStrange 15
  • No in-game sound

    No in-game sound

    Issue summary

    When rendering a game (e.g. Super Mario Bros.) using env.render() I get no in-game sound.

    I'm not sure if its supposed to have sound. If this is not a bug could you point me in the right direction? I would like to implement this my self, even if it doesn't get accepted, I'd like to use it. If it is a bug, same request :smile:. Thank you.

    System information

    • Ubuntu 18.04.1 LTS
    • Python 3.6.5
    • https://github.com/openai/retro/commit/684bd5f3db8a493a3a4c411f0654474e7af980ee
    enhancement 
    opened by axfcampos 14
  • My environment is rendered a few frames and then appears as lightblue screen.

    My environment is rendered a few frames and then appears as lightblue screen.

    Issue summary

    I'm trying to render the Sonic gameplay with PyCharm to see my A.I. performance, but the few things I get are a few frames (~10) and a light blue screen.

    Thanks in advance

    System information

    • [Hardware]: Ryzen 7 2700, GeForce 210
    • [Operating system]: Ubuntu 18.04
    • [Python version]: Python 3.6.5
    • [PyCharm version]: PyCharm 2018.1.4
    opened by YakoYakoYokuYoku 13
  • Installation error in windows 10

    Installation error in windows 10

    Issue summary

    Following error message is given during installation

     File "C:\Users\bikas\gym-retro\setup.py", line 46, in run
            pip.main(['install', 'cmake'])
        AttributeError: module 'pip' has no attribute 'main'
    
        ----------------------------------------
    Command "c:\users\bikas\anaconda3\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\bikas\\gym-retro\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps" failed with error code 1 in C:\Users\bikas\gym-retro\
    

    System information

    • Windows 10
    • Python 3.5.2
    • Gym Retro 0.5.4
    opened by ShuvenduRoy 12
  • Intense flickering of UI in retro integration tool

    Intense flickering of UI in retro integration tool

    When you load a rom in the integration tool, the UI starts to flicker.

    I generated a gif where I repro the bug: bug

    note: it flickers only when the game is running, not when paused

    System information

    Ubuntu 18.10 Python 3.6 gym-retro 0.7.0

    opened by MatPoliquin 11
  • Sonic 2 ROM not found

    Sonic 2 ROM not found

    Issue summary

    Whenever I try to run the environment in PyCharm it always gives the error that the ROM(game) is not found. Even thou Anaconda says I imported it, what am I doing wrong??

    System information

    • [Operating system] Win10
    • [Python version] Python 3.8
    • [Gym Retro version] 0.8.0
    opened by MysteriousHatter 10
  • Actions are a bit confusing

    Actions are a bit confusing

    I expected discrete actions to be filtered and actually wrote this in the docs but that doesn't appear to be the case. Seems like the interesting action spaces are: filtered multibinary (default), unfiltered multibinary (for replays), and filtered discrete (for approaches that require discrete actions).

    One approach would be to split filtering from the specific action space being used, so use_filtered_actions=True/False and then act_type=Multibinary,Discrete

    opened by christopherhesse 10
  • Bump setuptools from 40.5.0 to 65.5.1 in /docker/linux/build_scripts

    Bump setuptools from 40.5.0 to 65.5.1 in /docker/linux/build_scripts

    Bumps setuptools from 40.5.0 to 65.5.1.

    Release notes

    Sourced from setuptools's releases.

    v65.5.1

    No release notes provided.

    v65.5.0

    No release notes provided.

    v65.4.1

    No release notes provided.

    v65.4.0

    No release notes provided.

    v65.3.0

    No release notes provided.

    v65.2.0

    No release notes provided.

    v65.1.1

    No release notes provided.

    v65.1.0

    No release notes provided.

    v65.0.2

    No release notes provided.

    v65.0.1

    No release notes provided.

    v65.0.0

    No release notes provided.

    v64.0.3

    No release notes provided.

    v64.0.2

    No release notes provided.

    v64.0.1

    No release notes provided.

    v64.0.0

    No release notes provided.

    v63.4.3

    No release notes provided.

    v63.4.2

    No release notes provided.

    ... (truncated)

    Changelog

    Sourced from setuptools's changelog.

    v65.5.1

    Misc ^^^^

    • #3638: Drop a test dependency on the mock package, always use :external+python:py:mod:unittest.mock -- by :user:hroncok
    • #3659: Fixed REDoS vector in package_index.

    v65.5.0

    Changes ^^^^^^^

    • #3624: Fixed editable install for multi-module/no-package src-layout projects.
    • #3626: Minor refactorings to support distutils using stdlib logging module.

    Documentation changes ^^^^^^^^^^^^^^^^^^^^^

    • #3419: Updated the example version numbers to be compliant with PEP-440 on the "Specifying Your Project’s Version" page of the user guide.

    Misc ^^^^

    • #3569: Improved information about conflicting entries in the current working directory and editable install (in documentation and as an informational warning).
    • #3576: Updated version of validate_pyproject.

    v65.4.1

    Misc ^^^^

    • #3613: Fixed encoding errors in expand.StaticModule when system default encoding doesn't match expectations for source files.
    • #3617: Merge with pypa/distutils@6852b20 including fix for pypa/distutils#181.

    v65.4.0

    Changes ^^^^^^^

    v65.3.0

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump wheel from 0.31.1 to 0.38.1 in /docker/linux/build_scripts

    Bump wheel from 0.31.1 to 0.38.1 in /docker/linux/build_scripts

    Bumps wheel from 0.31.1 to 0.38.1.

    Changelog

    Sourced from wheel's changelog.

    Release Notes

    UNRELEASED

    • Updated vendored packaging to 22.0

    0.38.4 (2022-11-09)

    • Fixed PKG-INFO conversion in bdist_wheel mangling UTF-8 header values in METADATA (PR by Anderson Bravalheri)

    0.38.3 (2022-11-08)

    • Fixed install failure when used with --no-binary, reported on Ubuntu 20.04, by removing setup_requires from setup.cfg

    0.38.2 (2022-11-05)

    • Fixed regression introduced in v0.38.1 which broke parsing of wheel file names with multiple platform tags

    0.38.1 (2022-11-04)

    • Removed install dependency on setuptools
    • The future-proof fix in 0.36.0 for converting PyPy's SOABI into a abi tag was faulty. Fixed so that future changes in the SOABI will not change the tag.

    0.38.0 (2022-10-21)

    • Dropped support for Python < 3.7
    • Updated vendored packaging to 21.3
    • Replaced all uses of distutils with setuptools
    • The handling of license_files (including glob patterns and default values) is now delegated to setuptools>=57.0.0 (#466). The package dependencies were updated to reflect this change.
    • Fixed potential DoS attack via the WHEEL_INFO_RE regular expression
    • Fixed ValueError: ZIP does not support timestamps before 1980 when using SOURCE_DATE_EPOCH=0 or when on-disk timestamps are earlier than 1980-01-01. Such timestamps are now changed to the minimum value before packaging.

    0.37.1 (2021-12-22)

    • Fixed wheel pack duplicating the WHEEL contents when the build number has changed (#415)
    • Fixed parsing of file names containing commas in RECORD (PR by Hood Chatham)

    0.37.0 (2021-08-09)

    • Added official Python 3.10 support
    • Updated vendored packaging library to v20.9

    ... (truncated)

    Commits
    • 6f1608d Created a new release
    • cf8f5ef Moved news item from PR #484 to its proper place
    • 9ec2016 Removed install dependency on setuptools (#483)
    • 747e1f6 Fixed PyPy SOABI parsing (#484)
    • 7627548 [pre-commit.ci] pre-commit autoupdate (#480)
    • 7b9e8e1 Test on Python 3.11 final
    • a04dfef Updated the pypi-publish action
    • 94bb62c Fixed docs not building due to code style changes
    • d635664 Updated the codecov action to the latest version
    • fcb94cd Updated version to match the release
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • two agent competing environment

    two agent competing environment

    Hello,

    It would be nice if anyone could help me to integrate Mortal Kombat II Genesis in to two player (one could be previous version of the same model which is just performing actions based on observations) training environment. For example, how to pass action space for the second player in the way that the first one would not be able to use it? My email is [email protected].

    Merry Christmas!

    Best regards, Roberts

    opened by Franko9999 0
  • Bump certifi from 2018.10.15 to 2022.12.7 in /docker/linux/build_scripts

    Bump certifi from 2018.10.15 to 2022.12.7 in /docker/linux/build_scripts

    Bumps certifi from 2018.10.15 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Can't load roms in gym

    Can't load roms in gym

    Issue summary

    [Hi, I was setting up my project on a new pc and when I run my code I get this error:

    ---------------------------------------------------------------------------
    FileNotFoundError                         Traceback (most recent call last)
    Input In [1], in <cell line: 2>()
          1 #Import Dependencies
    ----> 2 import gym
          3 from stable_baselines3 import A2C
          4 from stable_baselines3.common.vec_env import VecFrameStack
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\gym\__init__.py:15, in <module>
          7 from gym.core import (
          8     Env,
          9     Wrapper,
       (...)
         12     RewardWrapper,
         13 )
         14 from gym.spaces import Space
    ---> 15 from gym.envs import make, spec, register
         16 from gym import logger
         17 from gym import vector
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\gym\envs\__init__.py:5, in <module>
          2 from gym.envs.registration import make, register, registry, spec
          4 # Hook to load plugins from entry points
    ----> 5 _load_env_plugins()
          8 # Classic
          9 # ----------------------------------------
         11 register(
         12     id="CartPole-v0",
         13     entry_point="gym.envs.classic_control.cartpole:CartPoleEnv",
         14     max_episode_steps=200,
         15     reward_threshold=195.0,
         16 )
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\gym\envs\registration.py:321, in load_env_plugins(entry_point)
        314         logger.warn(
        315             f"The environment namespace magic key `{plugin.name}` is unsupported. "
        316             "To register an environment at the root namespace you should specify "
        317             "the `__root__` namespace."
        318         )
        320 with context:
    --> 321     fn = plugin.load()
        322     try:
        323         fn()
    
    File ~\AppData\Local\Programs\Python\Python310\lib\importlib\metadata\__init__.py:171, in EntryPoint.load(self)
        166 """Load the entry point from its definition. If only a module
        167 is indicated by the value, return that module. Otherwise,
        168 return the named object.
        169 """
        170 match = self.pattern.match(self.value)
    --> 171 module = import_module(match.group('module'))
        172 attrs = filter(None, (match.group('attr') or '').split('.'))
        173 return functools.reduce(getattr, attrs, module)
    
    File ~\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py:126, in import_module(name, package)
        124             break
        125         level += 1
    --> 126 return _bootstrap._gcd_import(name[level:], package, level)
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\ale_py\gym.py:5, in <module>
          1 from collections import defaultdict, namedtuple
          3 from gym.envs.registration import register
    ----> 5 from ale_py.roms.utils import rom_name_to_id, rom_id_to_name
          8 GymFlavour = namedtuple("GymFlavour", ["suffix", "env_kwargs", "kwargs"])
          9 GymConfig = namedtuple("GymConfig", ["version", "env_kwargs", "flavours"])
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\ale_py\roms\__init__.py:89, in <module>
         85     return roms
         88 # Resolve all ROMs
    ---> 89 ROMS = resolve_roms()
         90 __all__ = list(ROMS.keys())
         93 def __dir__() -> List[str]:
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\ale_py\roms\__init__.py:40, in resolve_roms()
         36 for package in ROM_PLUGINS:
         38     try:
         39         # Resolve supported / unsupported roms
    ---> 40         supported, unsupported = package.resolve()
         42         # We'll now get the update delta. The reason for this is two fold:
         43         #     1) We should only display atari-py deprecation when it would have
         44         #        imported ROMs.
         45         #     2) ROM priority holds. When you import ROMs they'll all come from
         46         #        a single source of truth.
         47         #
         48         roms_delta_keys = list(
         49             filter(lambda rom: rom not in roms, supported.keys())
         50         )
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\ale_py\roms\utils.py:60, in SupportedPackage.resolve(self)
         56 unsupported: List[pathlib.Path] = []
         58 # Iterate over all ROMs in the specified package
         59 for resource in filter(
    ---> 60     lambda file: file.suffix == ".bin", resources.files(self.package).iterdir()
         61 ):
         62     resolved = resource.resolve()
         63     rom = ALEInterface.isSupportedROM(resolved)
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\importlib_resources\_common.py:22, in files(package)
         17 def files(package):
         18     # type: (Package) -> Traversable
         19     """
         20     Get a Traversable resource from a package
         21     """
    ---> 22     return from_package(get_package(package))
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\importlib_resources\_common.py:53, in get_package(package)
         47 def get_package(package):
         48     # type: (Package) -> types.ModuleType
         49     """Take a package name or module object and return the module.
         50 
         51     Raise an exception if the resolved module is not a package.
         52     """
    ---> 53     resolved = resolve(package)
         54     if wrap_spec(resolved).submodule_search_locations is None:
         55         raise TypeError(f'{package!r} is not a package')
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\importlib_resources\_common.py:44, in resolve(cand)
         42 def resolve(cand):
         43     # type: (Package) -> types.ModuleType
    ---> 44     return cand if isinstance(cand, types.ModuleType) else importlib.import_module(cand)
    
    File ~\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py:126, in import_module(name, package)
        124             break
        125         level += 1
    --> 126 return _bootstrap._gcd_import(name[level:], package, level)
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\atari_py\__init__.py:1, in <module>
    ----> 1 from .ale_python_interface import *
          2 from .games import get_game_path, list_games
          4 # default to only logging errors
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\atari_py\ale_python_interface.py:17, in <module>
         14     ale_lib = cdll.LoadLibrary(os.path.join(os.path.dirname(__file__),
         15                                             'ale_interface/libale_c.so'))
         16 else:
    ---> 17     ale_lib = cdll.LoadLibrary(os.path.join(os.path.dirname(__file__),
         18                                             'ale_interface/ale_c.dll'))
         20 ale_lib.ALE_new.argtypes = None
         21 ale_lib.ALE_new.restype = c_void_p
    
    File ~\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py:452, in LibraryLoader.LoadLibrary(self, name)
        451 def LoadLibrary(self, name):
    --> 452     return self._dlltype(name)
    
    File ~\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py:374, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
        371 self._FuncPtr = _FuncPtr
        373 if handle is None:
    --> 374     self._handle = _dlopen(self._name, mode)
        375 else:
        376     self._handle = handle
    
    FileNotFoundError: Could not find module 'C:\Users\shiva\AppData\Local\Programs\Python\Python310\lib\site-packages\atari_py\ale_interface\ale_c.dll' (or one of its dependencies). Try using the full path with constructor syntax.
    

    Code:

    import gym
    from stable_baselines3 import A2C
    from stable_baselines3.common.vec_env import VecFrameStack
    from stable_baselines3.common.evaluation import evaluate_policy
    from stable_baselines3.common.env_util import make_atari_env
    from stable_baselines3.common.env_util import make_vec_env
    
    import os
    from gym.utils import play
    from stable_baselines3.ddpg.policies import CnnPolicy
    from ale_py import ALEInterface
    
    ale = ALEInterface()
    from ale_py.roms import Breakout
    
    ale.loadROM(Breakout)
    env = gym.make('Breakout-v4', render_mode='human')
    env = VecFrameStack(make_atari_env("BreakoutNoFrameskip-v4"), n_stack=4)
    model = A2C.load(r"C:\Users\shiva\Documents\Atari_Breakout_RL_Project\Training\Logs\BreakoutNoFrameskipv4", env=env)
    mean_reward, std_reward = evaluate_policy(model, model.get_env(), n_eval_episodes=10, render=True)
    

    I have also installed the c++ build tools from microsoft's website. i am very confused as the same thing works on my older pc. Please help.

    ]

    System information

    • [OS - Windows 11]
    • [Python version - 3.10]
    • [Gym version - latest]
    opened by Shivam310 3
  • Hexadecimal memory locations for data.json

    Hexadecimal memory locations for data.json

    Currently, it appears that JSON not support hexadecimal memory addresses. What is the correct way to handle mapping these addresses?

    For example, my data.json file for the GameBoy game Super Mario Land looks like the following:

    {
      "info": {
        "gameover": {
          "address": C0A4,
          "type": "=d1"
        },
        "lives": {
          "address": DA15,
          "type": "=d1"
        },
        "coins-tens": {
          "address": 9829,
          "type": "=d1"
        },
        "coins-ones": {
          "address": 982A,
          "type": "=d1"
        },
        "current-world": {
          "address": 982C,
          "type": "=d1"
        },
        "current-stage": {
          "address": 982E,
          "type": "=d1"
        },
        "mario-x-pos": {
          "address": C202,
          "type": "=d1"
        },
        "mario-y-pos": {
          "address": C201,
          "type": "=d1"
        },
        "score": {
          "address": C0A0,
          "type": "=d4"
        }
      }
    }
    

    This, naturally, will fail to import, since the JSON parser has no idea about how to read those hexadecimal values. Do we just convert from hex to decimal, i.e., 0xC0A4 becomes 49316?

    Thank you!

    opened by isledge 1
Owner
OpenAI
OpenAI
RETRO-pytorch - Implementation of RETRO, Deepmind's Retrieval based Attention net, in Pytorch

RETRO - Pytorch (wip) Implementation of RETRO, Deepmind's Retrieval based Attent

Phil Wang 556 Jan 4, 2023
learn and have fun developing 2D retro games using python and pygame

Retro 2D Game Development Using Python + PyGame Skill up your programming skills with a walk down the memory lane. Learn how to create a retro 2D game

Marvin Trilles 1 Feb 23, 2022
A general-purpose, flexible, and easy-to-use simulator alongside an OpenAI Gym trading environment for MetaTrader 5 trading platform (Approved by OpenAI Gym)

gym-mtsim: OpenAI Gym - MetaTrader 5 Simulator MtSim is a simulator for the MetaTrader 5 trading platform alongside an OpenAI Gym environment for rein

Mohammad Amin Haghpanah 184 Dec 31, 2022
An open source Python library for the Snake retro game.

An open source Python library for the Snake retro game.

null 3 Jul 13, 2021
Pyxel is a retro game engine for Python.

Pyxel is open source and free to use. Let's start making a retro game with Pyxel!

Takashi Kitao 11.2k Jan 9, 2023
Flashback is an awesome, retro IRC based app built using Django

Flashback Flashback is an awesome, retro IRC based app built using Django (and the Django Rest Framework) for the backend as well as React for the fro

Unloading Gnat 1 Dec 22, 2021
A retro text-to-speech bot for Discord

hawking A retro text-to-speech bot for Discord, designed to work with all of the stuff you might've seen in Moonbase Alpha, using the existing command

Nick Schorr 23 Dec 25, 2022
A launcher to launch games from Riot Games under Linux

rito-launcher A launcher to launch games from Riot Games under Linux Requirements: Python 3, with the following pip plugins: 'configparser, pathlib, w

null 6 Mar 7, 2022
Datamining of 15 Days of (free) Games at the Epic Games Store (EGS).

EGS: 15 Days of Games This repository contains Python code to data-mine the 15 Days of (free) Games at the Epic Games Store (EGS). Requirements Instal

Wok 9 Dec 27, 2022
Scrapy-soccer-games - Scraping information about soccer games from a few websites

scrapy-soccer-games Esse projeto tem por finalidade pegar informação de tabela d

Caio Alves 2 Jul 20, 2022
Trading Gym is an open source project for the development of reinforcement learning algorithms in the context of trading.

Trading Gym Trading Gym is an open-source project for the development of reinforcement learning algorithms in the context of trading. It is currently

Dimitry Foures 535 Nov 15, 2022
Plug-n-Play Reinforcement Learning in Python with OpenAI Gym and JAX

coax is built on top of JAX, but it doesn't have an explicit dependence on the jax python package. The reason is that your version of jaxlib will depend on your CUDA version.

null 128 Dec 27, 2022
MasTrade is a trading bot in baselines3,pytorch,gym

mastrade MasTrade is a trading bot in baselines3,pytorch,gym idea we have for example 1 btc and we buy a crypto with it with market option to trade in

Masoud Azizi 18 May 24, 2022
gym-anm is a framework for designing reinforcement learning (RL) environments that model Active Network Management (ANM) tasks in electricity distribution networks.

gym-anm is a framework for designing reinforcement learning (RL) environments that model Active Network Management (ANM) tasks in electricity distribution networks. It is built on top of the OpenAI Gym toolkit.

Robin Henry 99 Dec 12, 2022
CL-Gym: Full-Featured PyTorch Library for Continual Learning

CL-Gym: Full-Featured PyTorch Library for Continual Learning CL-Gym is a small yet very flexible library for continual learning research and developme

Iman Mirzadeh 36 Dec 25, 2022
Implement A3C for Mujoco gym envs

pytorch-a3c-mujoco Disclaimer: my implementation right now is unstable (you ca refer to the learning curve below), I'm not sure if it's my problems. A

Andrew 70 Dec 12, 2022
A "gym" style toolkit for building lightweight Neural Architecture Search systems

A "gym" style toolkit for building lightweight Neural Architecture Search systems

Jack Turner 12 Nov 5, 2022
Customizable RecSys Simulator for OpenAI Gym

gym-recsys: Customizable RecSys Simulator for OpenAI Gym Installation | How to use | Examples | Citation This package describes an OpenAI Gym interfac

Xingdong Zuo 14 Dec 8, 2022
PowerGym is a Gym-like environment for Volt-Var control in power distribution systems.

Overview PowerGym is a Gym-like environment for Volt-Var control in power distribution systems. The Volt-Var control targets minimizing voltage violat

Siemens 44 Jan 1, 2023