Project description

Pymunk is a easy-to-use pythonic 2d physics library that can be used whenever
you need 2d rigid body physics from Python. Perfect when you need 2d physics
in your game, demo or other application! It is built on top of the very
capable 2d physics library Chipmunk.

The first version was released in 2007 and Pymunk is still actively developed
and maintained today.

Pymunk has been used with success in many projects, big and small. For example:
2 Pyweek game competition winners, more than 10 published scientific papers
and even in a self-driving car simulation! See the Showcases section on the
Pymunk webpage for some examples.

Contact & Support

Currently Pymunk has no separate forum, but uses the general Chipmunk
forum at http://chipmunk-physics.net/forum/index.php Many issues
are the same, like how to create a rag doll or why a fast moving object
pass through a wall. If you have a Pymunk specific question feel free to
mark your post with [pymunk] to make it stand out a bit.

Regardless of the method you use I will try to answer your questions as soon
as I see them. (And if you ask on SO or the forum other people might help as
well!)

Dependencies / Requirements

Basically Pymunk have been made to be as easy to install and distribute as
possible, usually pip install will take care of everything for you.

Python (Runs on CPython 2.7 and 3.X. Pypy and Pypy3)

Chipmunk (Source included, and on Windows and OSX its already compiled)

CFFI (will be installed automatically by Pip)

Setuptools (should be included with Pip)

GCC and friends (optional, you need it to compile Chipmunk)

Pygame (optional, you need it to run the Pygame based demos)

Pyglet (optional, you need it to run the Pyglet based demos)

Matplotlib & Jupyter Notebook (optional, you need it to run the Matplotlib
based demos)

Sphinx (optional, you need it to build documentation)

Python 2 & Python 3

Pymunk has been tested and runs fine on both Python 2 and Python 3. It has
been tested on recent versions of CPython (2 and 3) and Pypy. For an exact
list of tested versions see the Travis and Appveyor test configs.

Chipmunk Compilation

This section is only required in case you dont install pymunk the normal way
(pip install or setup.py install). Otherwise its handled automatically by
the install command.

Pymunk is built on top of the c library Chipmunk. It uses CFFI to interface
with the Chipmunk library file. Because of this Chipmunk has to be compiled
before it can be used with Pymunk. Compilation has to be done with GCC or
another compiler that uses the same flags.

The source distribution does not include a precompiled Chipmunk library file,
instead you need to build it yourself.

There are basically two options, either building it automatically as part of
installation using for example Pip:

> pip install pymunk-source-dist.zip

Or if you have the source unpacked / you got Pymunk by cloning its git repo,
you can explicitly tell Pymunk to compile it inplace:

> python setup.py build_ext --inplace

Note that chipmunk is actually not built as a python extension, but distutils /
setuptools doesn’t currently handle pure native libraries that needs to be built
in a good way if built with build_clib.

The compiled file goes into the /pymunk folder (same as space.py,
body.py and others).