Skip to content

Commit

Permalink
Constrain importlib-metadata and stable-baselines3 versions to be com…
Browse files Browse the repository at this point in the history
…patible with gym 0.21

* Constrain importlib-metadata < 5
* Constrain virtualenv==20.16.6 compatible with importlib-metadata<5
* Constrain stable-baselines3 < 2.0.0 compatible with gym 0.21
* Update the troubleshooting section of the install doc accordingly
  • Loading branch information
fteicht authored Sep 13, 2023
1 parent ce9a5ba commit c2362f0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,14 @@ jobs:
# preinstall gym==0.21.0 with legacy method (python setup.py) because its requirements list is broken
python -m pip install "pip==22" # starting with pip 23.1, gym 0.21.0 is not intallable anymore
python -m pip install "setuptools<67" # starting with setuptools 67, gym 0.21.0 is not intallable anymore
python -m pip install "importlib-metadata<5" "virtualenv==20.16.6" # cannot import gym with importlib-metadata >= 5 and python<3.8
python -m pip uninstall -y wheel # wheel must not be here to fall back directly to python setup.py
python -m pip install gym==0.21.0 --no-use-pep517
# preinstall ray[rllib]<2.3.0 because starting from 2.3.0, ray also install gym > 0.21
# preinstall ray[rllib]<2.3.0 because starting from 2.3.0, ray also installs gym > 0.21
python -m pip install --upgrade pip
python -m pip install "ray[rllib]<2.3.0"
# preinstall stable-baselines3<2.0.0 because starting from 2.0.0, stable-baselines3 requires gym > 0.26
python -m pip install "stable-baselines3<2.0.0"
# install remaining dependencies
python -m pip install pytest
Expand Down Expand Up @@ -516,11 +519,14 @@ jobs:
# preinstall gym==0.21.0 with legacy method (python setup.py) because its requirements list is broken
python -m pip install "pip==22" # starting with pip 23.1, gym 0.21.0 is not intallable anymore
python -m pip install "setuptools<67" # starting with setuptools 67, gym 0.21.0 is not intallable anymore
python -m pip install "importlib-metadata<5" "virtualenv==20.16.6" # cannot import gym with importlib-metadata >= 5 and python<3.8
python -m pip uninstall -y wheel # wheel must not be here to fall back directly to python setup.py
python -m pip install gym==0.21.0 --no-use-pep517
# preinstall ray[rllib]<2.3.0 because starting from 2.3.0, ray also install gym > 0.21
# preinstall ray[rllib]<2.3.0 because starting from 2.3.0, ray also installs gym > 0.21
python -m pip install --upgrade pip
python -m pip install "ray[rllib]<2.3.0"
# preinstall stable-baselines3<2.0.0 because starting from 2.0.0, stable-baselines3 requires gym > 0.26
python -m pip install "stable-baselines3<2.0.0"
# install remaining dependencies
python -m pip install pytest
Expand Down Expand Up @@ -606,11 +612,14 @@ jobs:
# preinstall gym==0.21.0 with legacy method (python setup.py) because its requirements list is broken
python -m pip install "pip==22" # starting with pip 23.1, gym 0.21.0 is not intallable anymore
python -m pip install "setuptools<67" # starting with setuptools 67, gym 0.21.0 is not intallable anymore
python -m pip install "importlib-metadata<5" "virtualenv==20.16.6" # cannot import gym with importlib-metadata >= 5 and python<3.8
python -m pip uninstall -y wheel # wheel must not be here to fall back directly to python setup.py
python -m pip install gym==0.21.0 --no-use-pep517
# preinstall ray[rllib]<2.3.0 because starting from 2.3.0, ray also install gym > 0.21
# preinstall ray[rllib]<2.3.0 because starting from 2.3.0, ray also installs gym > 0.21
python -m pip install --upgrade pip
python -m pip install "ray[rllib]<2.3.0"
# preinstall stable-baselines3<2.0.0 because starting from 2.0.0, stable-baselines3 requires gym > 0.26
python -m pip install "stable-baselines3<2.0.0"
# install remaining dependencies
python -m pip install pytest docopt commonmark
Expand Down Expand Up @@ -728,11 +737,14 @@ jobs:
# preinstall gym==0.21.0 with legacy method (python setup.py) because its requirements list is broken
python -m pip install "pip==22" # starting with pip 23.1, gym 0.21.0 is not intallable anymore
python -m pip install "setuptools<67" # starting with setuptools 67, gym 0.21.0 is not intallable anymore
python -m pip install "importlib-metadata<5" "virtualenv==20.16.6" # cannot import gym with importlib-metadata >= 5 and python<3.8
python -m pip uninstall -y wheel # wheel must not be here to fall back directly to python setup.py
python -m pip install gym==0.21.0 --no-use-pep517
# preinstall ray[rllib]<2.3.0 because starting from 2.3.0, ray also install gym > 0.21
# preinstall ray[rllib]<2.3.0 because starting from 2.3.0, ray also installs gym > 0.21
python -m pip install --upgrade pip
python -m pip install "ray[rllib]<2.3.0"
# preinstall stable-baselines3<2.0.0 because starting from 2.0.0, stable-baselines3 requires gym > 0.26
python -m pip install "stable-baselines3<2.0.0"
# find proper wheel and install it
python_version=${{ matrix.python-version }}
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*manylinux*.whl)
Expand Down
3 changes: 3 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,14 @@ The solution is to install it beforehand:
# preinstall gym==0.21.0 with legacy method (python setup.py) because its requirements list is broken
python -m pip install "pip==22" # starting with pip 23.1, gym 0.21.0 is not intallable anymore
python -m pip install "setuptools<67" # starting with setuptools 67, gym 0.21.0 is not intallable anymore
python -m pip install "importlib-metadata<5" "virtualenv==20.16.6" # cannot import gym with importlib-metadata >= 5 and python<3.8
python -m pip uninstall -y wheel # wheel must not be here to fall back directly to python setup.py
python -m pip install gym==0.21.0 --no-use-pep517
# preinstall ray[rllib]<2.3.0 because starting from 2.3.0, ray also install gym > 0.21
python -m pip install --upgrade pip
python -m pip install "ray[rllib]<2.3.0"
# preinstall stable-baselines3<2.0.0 because starting from 2.0.0, stable-baselines3 requires gym > 0.26
python -m pip install "stable-baselines3<2.0.0"
# install scikit-decide and remaining dependencies
pip install -U scikit-decide[all]
```
Expand Down

0 comments on commit c2362f0

Please sign in to comment.