views:

260

answers:

2

I want a python physics engine that works on mac and makes it easy to simulate physics. I have VPython and it works fine, but it is not quite what I want. VPython just shows visual elements and all the physics is in formulas. I looked at the documentation for PyODE and it looked like more what I want. It allowed you to add forces to masses and have worlds and things like that. When I tried to install PyODE (I am using a Mac), it didn't work. One reason was that I didn't have pyrex (I do have Cython, so maybe there is some way to have it use that?), but the other was that I didn't have ode installed. I looked and realized that PyODE is dependent on ode. I tried to install ode but that didn't work. Is there some documentation or binary or something that makes it easy to install PyODE on a mac? Or is there a similar module?
Edit:
This is the error I received when trying to install PyODE:

sh: ode-config: command not found
sh: ode-config: command not found
WARNING: <ode/ode.h> not found. You may have to adjust INC_DIRS.
INFO: Creating ode_trimesh.c
pyrexc -o ode_trimesh.c -I. -Isrc src/ode.pyx
sh: pyrexc: command not found
ERROR: An error occured while generating the C source file.

I got this error because pyrex and ode weren't installed. There was no documentation for installing ode on mac so there were no error messages for what I tried to do but the errors stayed the same for PyODE so ode wasn't installed.

+1  A: 

You can easily install ODE on your Mac with darwinports -- instructions here. You can easily list PyODE versions for darwinports -- then pick the right one for your chosen Python version -- by entering PyODE on the "search in darwinports" text box, and similarly for Pyrex (Cython is not 100% compatible with Pyrex, so it may not be worth the bother to tweak things for it... even though Cython tends to be better;-). Note that it will be easiest if you also install a Python version with darwinports rather than sticking to the one Apple supplies (the darwinports version will be more up-to-date and will have plenty more extensions available that might be more work to install on the Apple-supplied "system" Python).

Alex Martelli
I have installed python version 2.5, so I don't use the python apple supplies.
None
I tried to install ode via the port command but it said I needed xcode version 3.1. I have version 3.0. Is there any way I can install ode without xcode 3.1. I don't want to uninstall then reinstall the developer tools. The disk that came with the macbook had version 3.0 so I would have to get 3.1 from the internet which I don't want to do.
None
A: 

One of the errors indicates that you are missing pyrex. Perhaps try installing that first via darwinports, then work on the include directories.

voltagex