-
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
Box2d won't find some RAND_LIMIT_swigconstant #100
Comments
Ah, sorry, you need to install a backported swig 3.0: https://github.com/openai/gym/blob/box2dtests/.travis.yml#L20-L22. @jonasschneider is going to add code soon to make this error more friendly. LMK if you have trouble. |
Thanks for the response! Ran both selected lines, but it still throws the same error message. On another machine (ubuntu 12 x64 server), OpenAI gym wouldn't install without these lines, but after running them it started throwing these errors as well. |
Hm, @jonasschneider any ideas? |
Ah, sorry for not following up on this yet. This seems to be a really strange regression within SWIG -- taking a look at the failing source, the One of the only references to this issue that I could dig up is http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/2015q3.txt (grep for @justheuristic Could you do a |
I can confirm I'm having the same problem. @jonasschneider I initially had version
Unfortunately, I'm still seeing |
pybox2d builds from source in Linux and Mac just fine. SWIG is next to invisible, I have 3.0.8. I understand they were using deprecated SWIG features at a time they built pip package and it wasn't updated since then. The solution is to fix pip to fetch current sources, I believe. |
I also noticed @jonasschneider posted pybox2d/pybox2d#82 , on the first look it says the right thing (please update pypi package). I am not familiar with pip packaging system (pypi?) so maybe I got it wrong. |
Thanks for the response @olegklimov
|
@asmith26 did you compile pybox2d yourself? From a fresh git clone? |
swig is used while compiling the native code of Box2D, so after updating
On Mon, May 16, 2016 at 1:38 PM, asmith26 [email protected] wrote:
Trevor Blackwell [email protected] 650 776 7870 |
Many thanks @tlbtlbtlb - worked perfectly!! |
Got it running with @tlbtlbtlb 's tip, sorry for the delay. p.s. Anyone still has issues or this one can be closed? |
Still failing for me. SWIG Version 3.0.8 (built from source) $ git clone https://github.com/openai/gym PoleCart runs fine $ cat a.py $ python a.py no clue what's wrong... |
@TheBlueFrog - I don't think your
|
I do seem to have gotten past the swig issue $ sudo pip uninstall pybox2d $ sudo pip install pybox2d $ cat /home/mike/.pip/pip.log There is something broken in Box2D for sure... |
Try:
|
weirder I note warnings when installing box2d as root that I don't get when I'm getting the sense that there are two different box2d's around but $ pwd $ pip uninstall box2d-py $ sudo pip install box2d-py $ cat b.py $ python b.py // ///////////////////// try installing as user ///////////////////////////////// $ sudo pip uninstall box2d-py $ python b.py |
ah, when boxd is installed as root I note this but when installed as user |
Encountered this same issue. Ultimately appears to have resolved thanks to @tlbtlbtlb's tip. I had to install Box2D from source, though; the pip install did not work. |
@TheBlueFrog any updates here? Are you stuck at the same point with Box2D? |
Same here. SWIG Version 3.0.10. Tried removing and reinstalling gym and box2d-py to no meaningful result. Update: I managed to get it work by removing the Box2D installed with the gym and installing the new one from the git repository. It's important to remove all Box2D files before installation, because 'setup.py clean' doesn't do it. |
In a similar vain to @Ivanopolo I uninstalled my pip installation of box2d-py via |
On OSX, I was able to resolve the issue by following the instructions posted by @bram1et and @Ivanopolo. |
I'd like to share my experience for those who are still having this issue. On Ubuntu 14.04, I tried using swig 3.0.2 and 3.0.10 built from the source, but none of them worked. |
I had the same issue, and after following the instruction suggested above, i.e. pip uninstall box2d-py and then build from source for Box2D. It leads to a new error:
I am using Python 3 under Ubuntu 16.04 LTS, and all commands are running within an Anaconda environment. I had both conda install swig (latest version 3.0.10) and apt-get install swig (latest version 3.0.8) |
End-to-end, explicit steps for fixing this problem (at least for MacOSX), save u the hunt for instructions scattered here and there: brew install cmake boost boost-python sdl2 swig wget
git clone https://github.com/openai/gym.git
cd gym
pip install -e '.[all]' Try to run a Lunar Lander env, it will break (unless they fix it): import gym
env = gym.make('LunarLander-v2')
env.reset()
env.render() If it fails, debug as follow (and repeat once more if it fails again, glorious python): pip3 uninstall Box2D box2d-py
git clone https://github.com/pybox2d/pybox2d
cd pybox2d/
python setup.py clean
python setup.py build
python setup.py install |
Hi, @Instassa, it seems that your computer has not installed the box2d module successfully as expected, I guess there might exist some problems in directory path or python version, I see you are using anaconda's environment. Did you uninstall the original box2d module coming along with gym module completely? |
Hi @tarvos21, if you mean originally before this:
then I think yes, as my error first looks like |
If installing swig3.0 is not an option, here is a workaround. |
This had to be fixed, so I did. The local installation works now. Submitted the PR above, hope the team reviews soon. For those who can't wait, just install your gym from |
Sorry but the issue is still not solved in clusters.
Collecting PyOpenGL (from gym[all])
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-B8ZkMp/mujoco-py/ "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-B8ZkMp/mujoco-py/ |
nothing is working for me, I can't get my gym to uninstall due to this listed in freeze;
EDIT went and removed the egg-link from /usr/local/python2.7/dist-packages I still am unable to install anything and suspect everything is broken now. |
@kengz Your pull request appears to have been merged, but the issue still persists. Removing with |
@jrversteegh that worked for me! thanks |
Just wondering, when will the Box2d issue be completely resolved in https://github.com/openai/gym so that we do not have to deal with all these workarounds? |
@jrversteegh does not work for me. |
@jrversteegh that sorted it - thank you |
This issue is still reproducible: AttributeError: module '_Box2D' has no attribute 'RAND_LIMIT_swigconstant' I was using the LunarLander-v2 environment |
@solomatov When are you getting this error? Please put your code if my code doesnot solves the issue. |
Seems like this is already fixed in the latest gym release using the proper import gym
gym.make('LunarLander-v2') should pass without problem. |
For anyone still hitting this issue: you need to |
thx, that worked for me! |
* update to gym 0.23.1 * update HER * check for gym v0.26 and add info on vecenv wrapping of new gym API * check for gym v0.26 and update box2D installation see openai/gym#100 (comment) * update to gym v0.26 API * update to gym v0.26 * Fixes and reformat * Switch to Gymnasium --------- Co-authored-by: tlpss <[email protected]> Co-authored-by: Antonin Raffin <[email protected]>
Hello!
It's probably some silly mistake on my side, but i wasn't able to fix by random lever pulling, as usual.
Installing Box2d as in instuctions (using
pip install -e .[all]
) will throw error when trying to use some of Box2D examples.Code that reproduces the issue:
What didn't help:
The OS is Ubuntu 14.04 Server x64
It may be a clue that i am running the thing from inside python2 virtualenv (with all numpys, etc. installed)
The text was updated successfully, but these errors were encountered: