-
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
[Question] There is no Box2D even though I pip installed gym #2795
Comments
I have never seen this error before |
Hey both, I encountered the same problem trying to create gym/gym/envs/box2d/__init__.py Lines 1 to 2 in 95063a0
When I tried I got around the problem by installing Box2D manually with @pseudo-rnd-thoughts: I noticed that gym's |
adding on: perhaps it would be useful to raise an error message when importing Box2D causes |
@sidney-tio Thanks for the comment, I had never seen that try and except and will see if I can remove that I will investigate moving to the more recent box2d as a temporary solution as we planning on moving to brax which should improve performance for the environments however this could be a few months out at |
Hi again, I tried both of the solutions and they didn't work, here are the error messages:
Collecting gym[box2d] × python setup.py bdist_wheel did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. × Running setup.py install for box2d-py did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. × Encountered error while trying to install package. note: This is an issue with the package mentioned above, not pip.
Collecting box2d × python setup.py bdist_wheel did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. × Running setup.py install for box2d did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. × Encountered error while trying to install package. note: This is an issue with the package mentioned above, not pip. Sorry for the late reply |
The error was caused by swig |
if install swig doesnt work, try installing box2d manually (i.e.
|
After downloading swig I also had to
Solved the issue But I don't understand why doing such a menial task required this many steps, what was the problem here me or the gym library? |
So |
how am I supposed to install swig after downloading it ? |
@Ashfaqe-oss In Ubuntu it should just be |
|
I've tried installing swig first: |
When I uninstalled swig and reinstalled it I got WARNING: The script swig.exe is installed in 'C:[...]\Scripts' which is not on PATH. Might this explain the (error: command 'swig.exe' failed: None) when installing gym[box2d] ? |
@Louis1234567890, possibly, SWIG is a parser for Cpp to Python, so things could fail if that's not on PATH. That said, I've never developed code in Windows so I wouldn't know. |
thank you, it helps me |
Thanks, this helped me. |
EveryOne, Instead of box2d install pip install pygame to get rid of this headache. Hope problem answered successfuly |
Thank you immensely. Your solution was helpful and resolved my issue. |
If you ended up here because of the following error: Basically, Z shell interprets the square brackets as a pattern matching expression, and searches for files named "b" or "o" or "x" and so on. Enclosing it with quotations (' ') makes Zsh treat everything inside as a single string without any special characters. |
This solved my problem |
I could kiss you |
I am having trouble in a very simple task.
I am trying to run CarRacing environment with the following code
and it throws an error
AttributeError: module 'gym.envs.box2d' has no attribute 'CarRacing'
I tried to run another code that was proposed in another issue #2786 like this
but this time got the error
ModuleNotFoundError: No module named 'Box2D'
When I try to download Box2D with
it says
error: legacy-install-failure
and I searched online but solutions for gym doesnt really exist.
Thanks in advance.
The text was updated successfully, but these errors were encountered: