Mattsa008 / pybox2d

Automatically exported from code.google.com/p/pybox2d
Other
0 stars 0 forks source link

Box2D imports fine, nothing else does #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I tried to run every one of the examples from the testbed (after compiling 
pybox2d myself), and none of them worked because Box2D had no child 
objects.

For  example, test_Car.py:
Traceback (most recent call last):
  File "test_Car.py", line 22, in <module>
    from test_main import *
  File "/home/linus/pybox2d-read-only/testbed/test_main.py", line 31, in 
<module>
    exec("from %s_main import *" % fwSettings.backend)
  File "<string>", line 1, in <module>
  File "/home/linus/pybox2d-read-only/testbed/pygame_main.py", line 57, in 
<module>
    class fwDestructionListener(box2d.b2DestructionListener):
AttributeError: 'module' object has no attribute 'b2DestructionListener'

Here's why:

>>> import Box2D
>>> dir(Box2D)
['__builtins__', '__doc__', '__file__', '__loader__', '__name__', 
'__package__', '__path__', '__version__', '__version_info__']

I'm using the latest SVN version (currently 258) on ubuntu 9.10 (Karmic).

Original issue reported on code.google.com by Anonymou...@gmail.com on 1 Apr 2010 at 4:37

GoogleCodeExporter commented 8 years ago
My guess would be that you ran the examples from the main directory. There were 
some issues with that.

For the upcoming version, the library files are placed in a different directory 
and so this should not be an issue any longer.

Original comment by sir...@gmail.com on 5 Nov 2010 at 1:30

GoogleCodeExporter commented 8 years ago
Um... No offence, but I mentioned how firstly, the error was found in one of 
the examples, and secondly that importing Box2D in the python shell gave me an 
empty module called Box2D.

Original comment by Anonymou...@gmail.com on 5 Nov 2010 at 10:00

GoogleCodeExporter commented 8 years ago
Yes, but you did not specify your current directory when running the python 
interpreter or the examples. 

Perhaps your issue is different than the one at the bottom of the wiki:
http://code.google.com/p/pybox2d/wiki/BuildingfromSource

I would need more information about your setup to determine whether or not it's 
an actual issue.

Original comment by sir...@gmail.com on 5 Nov 2010 at 10:04

GoogleCodeExporter commented 8 years ago
I'm getting the same problem. What do you mean by: 

"For the upcoming version, the library files are placed in a different 
directory and so this should not be an issue any longer."

I did python setup.py install so I assumed the test bed apps would work.

Original comment by sto...@gmail.com on 6 May 2011 at 11:53

GoogleCodeExporter commented 8 years ago
Never mind; this was using the download file. The latest trunk works. Thanks

Original comment by sto...@gmail.com on 6 May 2011 at 11:59

GoogleCodeExporter commented 8 years ago
Oh, I need to try the SVN version then... Sorry, I didn't see that you'd 
updated the issue, sirkne - I was running the python interpreter from my home 
directory.

Original comment by Anonymou...@gmail.com on 7 May 2011 at 5:28