Farama-Foundation / Gymnasium

An API standard for single-agent reinforcement learning environments, with popular reference environments and related utilities (formerly Gym)
https://gymnasium.farama.org
MIT License
6.93k stars 770 forks source link

[Bug Report] gymnasium 0.0.1 is installed with python3.10 and unusable #316

Closed vmoens closed 1 year ago

vmoens commented 1 year ago

Describe the bug

In our CI we're checking the compatibility of the lib against multiple version of python. For python 3.10, tests fail when installing gymnasium with atari and ROM.

Code example

pip install gymnasium[accept-rom-license,atari] --no-cache

results in

Collecting gymnasium[accept-rom-license,atari]
  Downloading gymnasium-0.27.1-py3-none-any.whl (883 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 883.7/883.7 kB 154.4 MB/s eta 0:00:00
Requirement already satisfied: jax-jumpy>=0.2.0 in ./env/lib/python3.10/site-packages (from gymnasium[accept-rom-license,atari]) (0.2.0)
Requirement already satisfied: cloudpickle>=1.2.0 in ./env/lib/python3.10/site-packages (from gymnasium[accept-rom-license,atari]) (2.2.1)
Requirement already satisfied: gymnasium-notices>=0.0.1 in ./env/lib/python3.10/site-packages (from gymnasium[accept-rom-license,atari]) (0.0.1)
Requirement already satisfied: typing-extensions>=4.3.0 in ./env/lib/python3.10/site-packages (from gymnasium[accept-rom-license,atari]) (4.4.0)
Requirement already satisfied: numpy>=1.21.0 in ./env/lib/python3.10/site-packages (from gymnasium[accept-rom-license,atari]) (1.23.5)
Collecting shimmy[atari]<1.0,>=0.1.0
  Downloading Shimmy-0.2.0-py3-none-any.whl (25 kB)
Collecting autorom[accept-rom-license]~=0.4.2
  Downloading AutoROM-0.4.2-py3-none-any.whl (16 kB)
Requirement already satisfied: tqdm in ./env/lib/python3.10/site-packages (from autorom[accept-rom-license]~=0.4.2->gymnasium[accept-rom-license,atari]) (4.64.1)
Requirement already satisfied: requests in ./env/lib/python3.10/site-packages (from autorom[accept-rom-license]~=0.4.2->gymnasium[accept-rom-license,atari]) (2.28.2)
Requirement already satisfied: click in ./env/lib/python3.10/site-packages (from autorom[accept-rom-license]~=0.4.2->gymnasium[accept-rom-license,atari]) (8.1.3)
Collecting AutoROM.accept-rom-license
  Downloading AutoROM.accept-rom-license-0.5.4.tar.gz (12 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting shimmy[atari]<1.0,>=0.1.0
  Downloading Shimmy-0.1.0-py3-none-any.whl (20 kB)
INFO: pip is looking at multiple versions of numpy to determine which version is compatible with other requirements. This could take a while.
Collecting numpy>=1.21.0
  Downloading numpy-1.24.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.3/17.3 MB 242.7 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of jax-jumpy to determine which version is compatible with other requirements. This could take a while.
Collecting jax-jumpy>=0.2.0
  Downloading jax_jumpy-0.2.0-py3-none-any.whl (11 kB)
INFO: pip is looking at multiple versions of gymnasium-notices to determine which version is compatible with other requirements. This could take a while.
Collecting gymnasium-notices>=0.0.1
  Downloading gymnasium_notices-0.0.1-py3-none-any.whl (2.8 kB)
INFO: pip is looking at multiple versions of cloudpickle to determine which version is compatible with other requirements. This could take a while.
Collecting cloudpickle>=1.2.0
  Downloading cloudpickle-2.2.1-py3-none-any.whl (25 kB)
INFO: pip is looking at multiple versions of autorom[accept-rom-license] to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of gymnasium[accept-rom-license,atari] to determine which version is compatible with other requirements. This could take a while.
Collecting gymnasium[accept-rom-license,atari]
  Downloading gymnasium-0.27.0-py3-none-any.whl (879 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 879.1/879.1 kB 415.6 MB/s eta 0:00:00
  Downloading Gymnasium-0.26.3-py3-none-any.whl (836 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 836.9/836.9 kB 280.3 MB/s eta 0:00:00
  Downloading gymnasium-0.26.2-py3-none-any.whl (831 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 831.9/831.9 kB 417.8 MB/s eta 0:00:00
  Downloading gymnasium-0.26.1-py3-none-any.whl (830 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 830.4/830.4 kB 442.8 MB/s eta 0:00:00
  Downloading gymnasium-0.0.1-py3-none-any.whl (1.1 kB)
WARNING: gymnasium 0.0.1 does not provide the extra 'accept-rom-license'
WARNING: gymnasium 0.0.1 does not provide the extra 'atari'
Installing collected packages: gymnasium
Successfully installed gymnasium-0.0.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Then trying to import gymnasium fails:

(/root/project/env) [root@8575ce716209 project]# python -c """import gymnasium"""
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'gymnasium'


### System info

_No response_

### Additional context

This does not occur with gymnasium alone, but only occurs with Atari.
What seems to be happening is that atari looks for a gymnasium version that is compatible with it, and goes through 0.27, 0.26.3, 0.26.2, 0.26.1 and then 0.0.1 which I assume to be an empty wheel.

### Checklist

- [X] I have checked that there is no similar [issue](https://github.com/Farama-Foundation/Gymnasium/issues) in the repo
vmoens commented 1 year ago

This seems to be caused by a failure when installing ale-py 0.8:

(/root/project/env) [root@8575ce716209 project]# pip install ale-py[atari]==0.8
ERROR: Could not find a version that satisfies the requirement ale-py[atari]==0.8 (from versions: 0.7.2, 0.7.3, 0.7.4, 0.7.5)
ERROR: No matching distribution found for ale-py[atari]==0.8

which blocks the installation of shimmy and gymnasium

pseudo-rnd-thoughts commented 1 year ago

Gymnasium 0.0.1 was a placeholder version on pypi while the project was an idea and not forked yet and ensure that we kept the name. @jkterry1 Should we yank the 0.0.1 release now that the other versions are released?

I'm a bit confused at the ale-py[atari] as to my knowledge this doesn't exist. It is also weird that no 0.0.8 shows up in the possible version list

jkterry1 commented 1 year ago

@pseudo-rnd-thoughts yes, please yank 0.0.1

vmoens commented 1 year ago

Gymnasium 0.0.1 was a placeholder version on pypi while the project was an idea and not forked yet and ensure that we kept the name.

@jkterry1 Should we yank the 0.0.1 release now that the other versions are released?

I'm a bit confused at the ale-py[atari] as to my knowledge this doesn't exist. It is also weird that no 0.0.8 shows up in the possible version list

I investigated a bit and it's an ale-py thing

https://github.com/mgbellemare/Arcade-Learning-Environment/issues/478

Still, the fallback on gymnasium 0.0.1 is pretty bad as it reports the error to runtime and not setup as it should be

pseudo-rnd-thoughts commented 1 year ago

Ok, I have yanked the 0.0.1, @vmoens is it still an issue