Eclectic-Sheep / sheeprl

Distributed Reinforcement Learning accelerated by Lightning Fabric
https://eclecticsheep.ai
Apache License 2.0
303 stars 31 forks source link

Still needs to install `gymnasium[box2d]` #210

Closed LYK-love closed 7 months ago

LYK-love commented 7 months ago

Hello, when I try to install sheeprl from scratch, I found that even when I have followed your instructions to install the dependencies, I still have to install gymnasium[box2d] to run box2d envs.

Here's my workflow: First,

conda create -n sheeprl python=3.9
conda activate sheeprl

git clone git@github.com:Eclectic-Sheep/sheeprl.git
cd sheeprl
pip install .
pip install .\[atari,mujoco,dev,test\]

Next I try to train DreamerV3 on box2d CarRacing:

python sheeprl.py exp=dreamer_v3 env=gym env.id=CarRacing-v2 algo.cnn_keys.encoder=\[rgb\] algo=dreamer_v3_XS fabric.accelerator=gpu fabric.strategy=ddp fabric.devices=2 fabric.precision=16-mixed algo.learning_starts=1024

I got error:

Error in call to target 'gymnasium.envs.registration.make':
DependencyNotInstalled('Box2D is not installed, run `pip install gymnasium[box2d]`')

So I have to

pip install gymnasium\[box2d\]
belerico commented 7 months ago

Hi @LYK-love, this is intended right now, but i agree that the info is missing in the README. Can you try to install the env like this:

conda create -n sheeprl python=3.9
conda activate sheeprl

git clone git@github.com:Eclectic-Sheep/sheeprl.git
cd sheeprl
pip install .
pip install swig
pip install .\[atari,mujoco,dev,test,box2d\]
michele-milesi commented 7 months ago

Hi @LYK-love, we modified the default packages of SheepRL because of some problems in the execution of the GitHub actions and because we wanted a cleaner environment when we integrated SheepRL into DIAMBRA.

Now, to install box2d environments, you have to install manually as @belerico said. We will modify the table of supported environments in the README as soon as possible by adding the following two instructions for the box2d installation:

pip install swig
pip install .[box2d]