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
7.1k stars 788 forks source link

[Bug Report] Can't install the Gymnasium with Atari dependencies. #1081

Closed breuderink closed 4 months ago

breuderink commented 4 months ago

Describe the bug

I followed the instructions to install the Atari extras from the documentation:

pip install "gymnasium[atari]"

However, it fails with an error (see below).

Code example

ERROR: Cannot install gymnasium[atari]==0.26.1, gymnasium[atari]==0.26.2 and gymnasium[atari]==0.26.3 because these package versions have conflicting dependencies.

The conflict is caused by:
    gymnasium[atari] 0.26.3 depends on ale-py~=0.8.0; extra == "atari"
    gymnasium[atari] 0.26.2 depends on ale-py~=0.8.0; extra == "atari"
    gymnasium[atari] 0.26.1 depends on ale-py~=0.8.0; extra == "atari"

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

System info

Installed with pip, in a virtual env on MacOS Sonoma 14.5 and Python 3.12.3.

Additional context

No response

Checklist

pseudo-rnd-thoughts commented 4 months ago

Ale-py doesn't have a python 3.12 build

You will either have to use a lower python version or ale-py 0.9.0

Anri-Lombard commented 2 months ago

The latter does not work.

Here is my ale-py version:

Name: ale-py
Version: 0.9.0
Summary: The Arcade Learning Environment (ALE) - a platform for AI research.
Home-page: https://github.com/Farama-Foundation/Arcade-Learning-Environment
Author: Marc G. Bellemare, Yavar Naddaf, Joel Veness, Michael Bowling
Author-email: 
License: GPLv2
Location: [/Users/anrilombard/Desktop/RL/.venv/lib/python3.12/site-packages](https://file+.vscode-resource.vscode-cdn.net/Users/anrilombard/Desktop/RL/.venv/lib/python3.12/site-packages)
Requires: numpy
Required-by:

Here is the output:

Requirement already satisfied: gymnasium[atari] in /Users/anrilombard/Desktop/RL/.venv/lib/python3.12/site-packages (0.29.1)
Requirement already satisfied: numpy>=1.21.0 in /Users/anrilombard/Desktop/RL/.venv/lib/python3.12/site-packages (from gymnasium[atari]) (2.0.1)
Requirement already satisfied: cloudpickle>=1.2.0 in /Users/anrilombard/Desktop/RL/.venv/lib/python3.12/site-packages (from gymnasium[atari]) (3.0.0)
Requirement already satisfied: typing-extensions>=4.3.0 in /Users/anrilombard/Desktop/RL/.venv/lib/python3.12/site-packages (from gymnasium[atari]) (4.12.2)
Requirement already satisfied: farama-notifications>=0.0.1 in /Users/anrilombard/Desktop/RL/.venv/lib/python3.12/site-packages (from gymnasium[atari]) (0.0.4)
Collecting shimmy<1.0,>=0.1.0 (from shimmy[atari]<1.0,>=0.1.0; extra == "atari"->gymnasium[atari])
  Using cached Shimmy-0.2.1-py3-none-any.whl.metadata (2.3 kB)
INFO: pip is looking at multiple versions of shimmy[atari] to determine which version is compatible with other requirements. This could take a while.
Collecting shimmy[atari]<1.0,>=0.1.0 (from gymnasium[atari])
  Using cached Shimmy-0.2.0-py3-none-any.whl.metadata (5.2 kB)
  Using cached Shimmy-0.1.0-py3-none-any.whl.metadata (2.1 kB)
Collecting gymnasium[atari]
  Using cached gymnasium-0.29.1-py3-none-any.whl.metadata (10 kB)
  Using cached gymnasium-0.29.0-py3-none-any.whl.metadata (10 kB)
INFO: pip is still looking at multiple versions of shimmy[atari] to determine which version is compatible with other requirements. This could take a while.
  Using cached gymnasium-0.28.1-py3-none-any.whl.metadata (9.2 kB)
Collecting jax-jumpy>=1.0.0 (from gymnasium[atari])
  Using cached jax_jumpy-1.0.0-py3-none-any.whl.metadata (15 kB)
Collecting gymnasium[atari]
  Using cached gymnasium-0.28.0-py3-none-any.whl.metadata (9.2 kB)
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
  Using cached gymnasium-0.27.1-py3-none-any.whl.metadata (8.5 kB)
Collecting gymnasium-notices>=0.0.1 (from gymnasium[atari])
  Using cached gymnasium_notices-0.0.1-py3-none-any.whl.metadata (1.1 kB)
Collecting gymnasium[atari]
  Using cached gymnasium-0.27.0-py3-none-any.whl.metadata (8.5 kB)
  Using cached Gymnasium-0.26.3-py3-none-any.whl.metadata (5.8 kB)
INFO: pip is looking at multiple versions of gymnasium[atari] to determine which version is compatible with other requirements. This could take a while.
  Using cached gymnasium-0.26.2-py3-none-any.whl.metadata (4.1 kB)
  Using cached gymnasium-0.26.1-py3-none-any.whl.metadata (4.1 kB)
ERROR: Cannot install gymnasium[atari]==0.26.1, gymnasium[atari]==0.26.2 and gymnasium[atari]==0.26.3 because these package versions have conflicting dependencies.

The conflict is caused by:
    gymnasium[atari] 0.26.3 depends on ale-py~=0.8.0; extra == "atari"
    gymnasium[atari] 0.26.2 depends on ale-py~=0.8.0; extra == "atari"
    gymnasium[atari] 0.26.1 depends on ale-py~=0.8.0; extra == "atari"

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip to attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Anri-Lombard commented 2 months ago

I see a lower python version works :)

durgadarba97 commented 2 months ago

which version of python did you use? I'm using 3.9.2 and I'm getting the same issue

Anri-Lombard commented 2 months ago

@durgadarba97 I used version 3.11.6