I cannot figure out how to install Gym Retro. I follow the official documentation but without success. I have tried to check further online sources but again no useful.
These are the official instructions from the documentation
(venv) $ cd ./lib/python3.7/site-packages
(venv) $ git clone https://github.com/openai/retro.git gym-retro
(venv) $ cd gym-retro
(venv) $ python -m pip install -e .
running with a fresh downloaded Python 3.7 as required
(venv) $ python --version
Python 3.7.17
Some info about my running Debian OS
>>> import platform
>>> uname = platform.uname()
>>> for attr in ['system', 'release', 'version', 'machine']:
print(f"{attr:<12} {getattr(uname, attr)}")
...
system Linux
release 5.10.0-28-amd64
version #1 SMP Debian 5.10.209-2 (2024-01-31)
machine x86_64
The packages installed in the virtual environment
(venv) $ python -m pip freeze
cloudpickle==2.2.1
cmake==3.29.0.1
Farama-Notifications==0.0.4
gym==0.26.2
gym-notices==0.0.8
gymnasium==0.28.1
importlib-metadata==6.7.0
jax-jumpy==1.0.0
neat-python==0.92
numpy==1.21.6
typing_extensions==4.7.1
zipp==3.15.0
and some OS dependencies
sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev python3-setuptools python3-dev python3-numpy
sudo apt install libopenmpi-dev python3-dev zlib1g-dev
sudo apt install cmake
sudo apt install libblas3
sudo apt install libatlas-base-dev gfortran
sudo apt install zlib1g-dev
I got the following error when running (venv) $ python -m pip install -e . in the above mentioned snippet:
Obtaining file:///MY_PATH/venv/lib/python3.7/site-packages/gym-retro
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Checking if build backend supports build_editable: started
Checking if build backend supports build_editable: finished with status 'done'
Getting requirements to build editable: started
Getting requirements to build editable: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing editable metadata (pyproject.toml): started
Preparing editable metadata (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Preparing editable metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [57 lines of output]
/MY_PATH/venv/lib/python3.7/site-packages/gym-retro/setup.py:12: ResourceWarning: unclosed file <_io.TextIOWrapper name='/MY_PATH/venv/lib/python3.7/site-packages/gym-retro/README.md' mode='r' encoding='UTF-8'>
README = open(os.path.join(SCRIPT_DIR, "README.md")).read()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/MY_PATH/venv/lib/python3.7/site-packages/gym-retro/setup.py:81: ResourceWarning: unclosed file <_io.TextIOWrapper name='/MY_PATH/venv/lib/python3.7/site-packages/gym-retro/VERSION' mode='r' encoding='UTF-8'>
version=open(VERSION_PATH, 'r').read().strip(),
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/tmp/pip-build-env-vg9giy95/normal/lib/python3.7/site-packages/setuptools_scm/version.py:84: UserWarning: tag 'f347d7e' no version found
warnings.warn(f"tag {tag!r} no version found")
Traceback (most recent call last):
File "/MY_PATH/venv/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/MY_PATH/venv/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/MY_PATH/venv/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 181, in prepare_metadata_for_build_editable
return hook(metadata_directory, config_settings)
File "/tmp/pip-build-env-vg9giy95/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 455, in prepare_metadata_for_build_editable
metadata_directory, config_settings
File "/tmp/pip-build-env-vg9giy95/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 380, in prepare_metadata_for_build_wheel
self.run_setup()
File "/tmp/pip-build-env-vg9giy95/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 488, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-vg9giy95/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 96, in <module>
File "/tmp/pip-build-env-vg9giy95/overlay/lib/python3.7/site-packages/setuptools/__init__.py", line 107, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-vg9giy95/overlay/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 147, in setup
_setup_distribution = dist = klass(attrs)
File "/tmp/pip-build-env-vg9giy95/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 490, in __init__
for k, v in attrs.items()
File "/tmp/pip-build-env-vg9giy95/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 283, in __init__
self.finalize_options()
File "/tmp/pip-build-env-vg9giy95/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 925, in finalize_options
ep(self)
File "/tmp/pip-build-env-vg9giy95/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 945, in _finalize_setup_keywords
ep.load()(self, ep.name, value)
File "/tmp/pip-build-env-vg9giy95/normal/lib/python3.7/site-packages/setuptools_scm/integration.py", line 91, in version_keyword
_assign_version(dist, config)
File "/tmp/pip-build-env-vg9giy95/normal/lib/python3.7/site-packages/setuptools_scm/integration.py", line 60, in _assign_version
maybe_version = _get_version(config)
File "/tmp/pip-build-env-vg9giy95/normal/lib/python3.7/site-packages/setuptools_scm/__init__.py", line 153, in _get_version
parsed_version = _do_parse(config)
File "/tmp/pip-build-env-vg9giy95/normal/lib/python3.7/site-packages/setuptools_scm/__init__.py", line 100, in _do_parse
version = _version_from_entrypoints(config) or _version_from_entrypoints(
File "/tmp/pip-build-env-vg9giy95/normal/lib/python3.7/site-packages/setuptools_scm/_entrypoints.py", line 66, in _version_from_entrypoints
version: ScmVersion | None = _call_entrypoint_fn(root, config, ep.load())
File "/tmp/pip-build-env-vg9giy95/normal/lib/python3.7/site-packages/setuptools_scm/_entrypoints.py", line 40, in _call_entrypoint_fn
return fn(root, config=config)
File "/tmp/pip-build-env-vg9giy95/normal/lib/python3.7/site-packages/setuptools_scm/git.py", line 182, in parse
config, wd, describe_command=describe_command, pre_parse=pre_parse
File "/tmp/pip-build-env-vg9giy95/normal/lib/python3.7/site-packages/setuptools_scm/git.py", line 231, in _git_parse_inner
config=config,
File "/tmp/pip-build-env-vg9giy95/normal/lib/python3.7/site-packages/setuptools_scm/version.py", line 226, in meta
parsed_version = _parse_tag(tag, preformatted, config)
File "/tmp/pip-build-env-vg9giy95/normal/lib/python3.7/site-packages/setuptools_scm/version.py", line 203, in _parse_tag
assert version is not None
AssertionError
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
It seems that the editable metadata (pyproject.toml) is the problem but I don't know what it is.
What is missing to install properly Gym Retro?
Note that
- all other packages were installed directly with
(venv) $ python -m pip install <package_name> MY_PATHin the error traceback is edited by me.