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

Box2d won't find some RAND_LIMIT_swigconstant #1015

Closed
Omegastick opened this issue Apr 24, 2018 · 9 comments
Closed

Box2d won't find some RAND_LIMIT_swigconstant #1015

Omegastick opened this issue Apr 24, 2018 · 9 comments

Comments

@Omegastick
Copy link

As far as I'm aware, #100 isn't fixed, but is still closed. This has been acknowledged a couple of times in that issue but isn't being reopened for some reason.

A workaround is to uninstall box2d-kengz (pip uninstall box2d-kengz) then install pybox2d.

Can we get pybox2d as a dependency for gym perhaps?

@brtkwr
Copy link

brtkwr commented May 7, 2018

i also have this issue

@aransena
Copy link

aransena commented Jun 7, 2018

Just to pitch in as I haven't seen this particular error/solution noted previously, I've just had this same issue and found it was due to missing a package that would cause an error during Box2D installation, but not stop the installation process.

First uninstall Box2D
pip uninstall Box2D

If you try reinstall with pip install Box2D, and see this launchpadlib error
launchpadlib 1.10.3 requires testresources, which is not installed.

Uninstall Box2D again, and then install testresources
pip install testresources

Then finally resintall Box2D, hopefully now your code runs.
pip install Box2D

@DuaneNielsen
Copy link

DuaneNielsen commented Jul 19, 2018

Yeah, I just hit this same issue on gym.version 0.10.5. In fact, Box2D did not correctly install as a dependency of gym, then when manually installed on macos, it borks with this "RAND_LIMIT" error. Perhaps Box2D was not the best design choice? Maybe it should be replaced with something more reliable and cross platform?

@alexp9982
Copy link

Thank you so much aransena, you have fixed my problem!

@avilay
Copy link

avilay commented Nov 12, 2018

Install pybox2d (not available on pypi) instead of Box2D

Hit this issue on Debian 9. Had swig 3.0.10 (this is the one that is installed by default upon running)

sudo apt install swig

My issue was that I was installing a Python package called Box2D. But when I uninstalled Box2D and installed pybox2d (https://github.com/pybox2d/pybox2d) everything started to work. Note, pybox2d is not available on pypi, so you have to install it following the instructions in INSTALL.md in the github repo. But here it is for your convenience:

Download the repo

wget https://github.com/pybox2d/pybox2d/archive/master.zip

Unzip the source

unzip master.zip

Change directory to the unzipped directory

cd pybox2d-master

Build Box2D

This is the original Box2D C++ package found here (https://box2d.org/) and does not own the Python package Box2D.

python3 setup.py build

Ignore all warnings it shows.

Install pybox2d

python3 setup.py install

Depending on python3 installation, you might have to run the last command with a sudo.

@christopherhesse
Copy link
Contributor

This should be fixed with box2d-py (not pybox2d) that we now use in setup.py, please file a new issue if that is not the case: https://github.com/openai/gym/blob/master/setup.py#L11

@asawaswapnil
Copy link

pip install --user box2d-py==2.3.5
solved the problem

1 similar comment
@asawaswapnil
Copy link

pip install --user box2d-py==2.3.5
solved the problem

@Kamier1
Copy link

Kamier1 commented May 30, 2023

Thank you so much !
pip install --user box2d-py==2.3.5

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

No branches or pull requests

9 participants