Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still needs to install gymnasium[box2d] #210

Closed
LYK-love opened this issue Feb 22, 2024 · 2 comments · Fixed by #215
Closed

Still needs to install gymnasium[box2d] #210

LYK-love opened this issue Feb 22, 2024 · 2 comments · Fixed by #215
Assignees

Comments

@LYK-love
Copy link

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
Copy link
Member

belerico commented Feb 22, 2024

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
Copy link
Member

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]

@michele-milesi michele-milesi self-assigned this Feb 26, 2024
@michele-milesi michele-milesi linked a pull request Feb 26, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants