-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
[Bug Report] Dependency error - box2D #3240
Comments
What was the issue with running |
When trying to pip install gymnasium[box2d]: Failed to build box2d-py |
more importantly, your installation instructions do not say to install box2d so you need to fix those. |
If you read the whole error when install box2d, you will see that it most likely says So you will lneed to install swig - https://www.swig.org/download.html |
swig fails to install as well: The real problem is that not all of the requirements are included in this package to properly install using pip or condo. You shouldn't make the user have to figure out what you are missing. |
Dear @drjoeCV , The traceback provided detailed information about the import failures, with errors pointing to missing shared object files and unresolvable module imports within the Python environment, specifically Python version 3.7. To resolve this issue, I found a solution that worked for me in a GitHub issue thread. It involved installing additional packages beyond what I had initially set up. By running I hope this solution will be helpful for you. |
Tried to use gymnasium on several platforms and always get unresolvable error
Code example
import gymnasium as gym
env = gym.make("LunarLander-v2", render_mode="human")
ModuleNotFoundError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/gym/envs/box2d/bipedal_walker.py in
14 try:
---> 15 import Box2D
16 from Box2D.b2 import (
ModuleNotFoundError: No module named 'Box2D'
During handling of the above exception, another exception occurred:
DependencyNotInstalled Traceback (most recent call last)
15 frames
/usr/local/lib/python3.10/dist-packages/gym/envs/box2d/bipedal_walker.py in
23 )
24 except ImportError:
---> 25 raise DependencyNotInstalled("box2D is not installed, run
pip install gymnasium[box2d]
")26
27
DependencyNotInstalled: box2D is not installed, run
pip install gymnasium[box2d]
pip install gymnasium
System Info
Describe the characteristic of your environment:
Same error in all of these scenarios under python 3.11
Additional context
Trying to fix via
pip install gymnasium[box2d]
fails on all three scenariosThe text was updated successfully, but these errors were encountered: