Building PyBullet on Windows

PyBullet is a wrapper around the popular Bullet C++ physics library.

Once you’ve build the C++ Bullet library you can then build PyBullet.

The PyBullet documentation states to use the –include-dirs directive to add the Bullet include path, but it also requires the numpy include directory which didn’t resolve automatically for me. Unfortunately you can’t just append it to the –include-dirs flag.

I resolved it with the following:

cd path\to\PyBullet

set INCLUDE=%INCLUDE%;c:\path\to\python\site-packages\numpy\core\include

python build_ext –include-dirs c:\path\to\bullet\src –library-dirs c:\path\to\bullet\msvc\2008\lib\Release

Obviously you replace the \msvc\2008 directory with the appropriate one if you didn’t build the vanilla target.

After this, copy the file PyBullet\build\lib.win32-2.6\bullet\bullet.pyd to PyBullet\bullet.

Include the PyBullet\bullet directory in your Python project and import.

You should now be able to do the following:

import bullet.bullet as bullet

print help(bullet)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: