Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install pymunk

How to install pymunk

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install pymunk
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
2.1.0
4.0.0Never BuiltWhy not?
2.1.0 Available View build log
2.0.0 Available View build log
1.0.0 Available View build log
Windows (64-bit)
2.1.0
4.0.0Never BuiltWhy not?
2.1.0 Available View build log
2.0.0 Available View build log
1.0.0 Available View build log
Mac OS X (10.5+)
2.1.0
4.0.0Never BuiltWhy not?
2.1.0 Available View build log
2.0.0 Available View build log
1.0.0 Available View build log
Linux (32-bit)
3.0.0
4.0.0Never BuiltWhy not?
3.0.0 Available View build log
2.1.0 Available View build log
2.0.0 Available View build log
1.0.0 Available View build log
Linux (64-bit)
4.0.0 Available View build log
3.0.0 Available View build log
2.1.0 Available View build log
2.0.0 Available View build log
1.0.0 Available View build log
 
License
MIT License
Depended by
Lastest release
version 4.0.0 on Jan 9th, 2014

About

pymunk is a easy-to-use pythonic 2d physics library that can be used whenever you need 2d rigid body physics from Python. It is built on top of the very nice 2d physics library Chipmunk.

2007 - 2013, Victor Blomqvist - vb@viblo.se, MIT License

This release is based on the latest pymunk release (4.0.0), using chipmunk 6.2 rev 3bdf1b7b3c (source included)

Homepage:http://www.pymunk.org
Forum:http://chipmunk-physics.net/forum/
Email:vb@viblo.se
Getting the latest SVN copy:
 svn checkout http://pymunk.googlecode.com/svn/trunk pymunk-read-only
Chipmunk:http://chipmunk-physics.net/

How to Use

pymunk ships with a number of demos in the examples directory, and its complete documentation including API Reference.

If chipmunk doesnt ship with a chipmunk binary your platform can understand (currently Windows and Linux 32bit and 64 bit are included) you will have to compile chipmunk before install. See section CHIPMUNK in this readme for (very simple) instructions.

To install you can either run:

> python setup.py install

or simply put the pymunk folder where your program/game can find it. (like /my_python_scripts/yourgame/pymunk). The chipmunk binary library is located in the pymunk folder.

The easy way to get started is to check out the examples/ directory, and run 'run.py python arrows.py' and so on, and see what each one does :)

Example

Quick code example:

import pymunk               # Import pymunk..

space = pymunk.Space()      # Create a Space which contain the simulation
space.gravity = 0,-1000     # Set its gravity

body = pymunk.Body(1,1666)  # Create a Body with mass and moment
body.position = 50,100      # Set the position of the body

poly = pymunk.Poly.create_box(body) # Create a box shape and attach to body
space.add(body, poly)       # Add both body and shape to the simulation

while True:                 # Infinite loop simulation
    space.step(0.02)        # Step the simulation one step forward

For more detailed and advanced examples, take a look at the included demos (in examples/).

Dependencies / Requirements

  • python (tested on cpython 2.6, 2.7 and 3.2, 3.3. Also on pypy 2.1)
  • chipmunk (pymunk ships with a set of chipmunk libraries)
  • pygame (optional, you need it to run most of the demos)
  • pyglet (optional, you need it to run the moon buggy demo)
  • sphinx (optional, you need it to build documentation)
  • ctypeslib & GCC_XML (optional, you need them to generate new bindings)

Chipmunk

Compiled libraries of Chipmunk compatible Windows and Linux 32bit and 64bit are distributed with pymunk. If pymunk doesnt have your particular platform included, you can compile Chipmunk by hand with a custom setup argument:

> python setup.py build_chipmunk

The compiled file goes into the /pymunk folder (same as _chipmunk.py, util.py and others). If the compile fail, please check the readme in chipmunk_src for generic instructions on how to compile with gcc, or download the relevant release from Chipmunk homepage and follow its instructions.

Subscribe to package updates

Last updated Jan 9th, 2014

Download Stats

Last month:8

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.