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 cannot be imported in a tensorflow env #615

Closed
yuvalewi opened this issue Jun 9, 2017 · 2 comments
Closed

Box2D cannot be imported in a tensorflow env #615

yuvalewi opened this issue Jun 9, 2017 · 2 comments

Comments

@yuvalewi
Copy link

yuvalewi commented Jun 9, 2017

Hello,
I am trying to run LunarLander-v2 on Ububtu 16.
If I am opening ipython i can do import Box2D without an error.
Unfortunately, I am using a python virtualenv for tensorflow. At this env I get the following:

In [1]: import Box2D
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-be4d5ad96d72> in <module>()
----> 1 import Box2D

/home/yuval/tensorflow/lib/python2.7/site-packages/Box2D/__init__.py in <module>()
     18 # 3. This notice may not be removed or altered from any source distribution.
     19 #
---> 20 from .Box2D import *
     21 __author__ = '$Date$'
     22 __version__ = '2.3.3'

/home/yuval/tensorflow/lib/python2.7/site-packages/Box2D/Box2D.py in <module>()
    432     """b2CheckPolygon(b2PolygonShape shape, bool additional_checks=True) -> bool"""
    433     return _Box2D.b2CheckPolygon(shape, additional_checks)
--> 434 RAND_LIMIT = _Box2D.RAND_LIMIT
    435 
    436 def b2Random(*args):

AttributeError: 'module' object has no attribute 'RAND_LIMIT'

I tried to install swig from scratch as well as pybox2d (As suggested at #100 (comment)).
But nothing worked.

Do you guys have any suggestions?

@jenleong
Copy link

jenleong commented Jun 26, 2017

I'm running on Mac OS X, and when I try to make the 'LunarLanding-v2' gym environment, I get the same error:

~/anaconda/envs/openai/lib/python3.6/site-packages/Box2D/Box2D.py in <module>()
    432     """b2CheckPolygon(b2PolygonShape shape, bool additional_checks=True) -> bool"""
    433     return _Box2D.b2CheckPolygon(shape, additional_checks)
--> 434 RAND_LIMIT = _Box2D.RAND_LIMIT
    435 
    436 def b2Random(*args):

AttributeError: module 'Box2D._Box2D' has no attribute 'RAND_LIMIT'

@olegklimov
Copy link
Contributor

Dup #100

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

3 participants