pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
pymunk

pymunk - 0.8.1

Victor Blomqvist (viblo)

Tags:

Description

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, http://chipmunk-physics.net/

pymunk vision

Make 2d physics easy to include in your game

It is (or striving to be):

  • Easy to use It should be easy to use, no complicated stuff should be needed to add physics to your game/program.
  • "Pythonic" It should not be visible that a c-library (chipmunk) is in the bottom, it should feel like a python library (no strange naming, OO, no memory handling and more)
  • Simple to build & install You shouldnt need to have a zillion of libraries installed to make it install, or do a lot of command line trixs.
  • Multiplatform Should work on both windows, nix and OSX.
  • Non-intrusive It should not put restrictions on how you structure your program and not force you to use a special game loop, it should be possible to use with other libraries like pygame and pyglet.

Please check its homepage at pymunk.org for full details of the library

Changes

Changes from 0.8:
  • Updated chipmunk to the newly released 4.1.0 version
  • API documentation improvements
  • Bug fixes and cleanup
  • Fixes for all the issues reported to this page (until today)

Links

Home Page: http://pymunk.org
Source: http://pymunk.googlecode.com/files/pymunk-0.8.1.zip
Windows: http://pymunk.googlecode.com/files/pymunk-0.8.1.win32.exe

Screenshot


click to view original size

Releases

pymunk - 4.0.0 - Aug 25, 2013
pymunk - 3.0.0 - Sep 2, 2012
pymunk - 1.0.0 - Mar 17, 2010
pymunk - 0.8.4 - Aug 16, 2009
pymunk - 0.8.3 - Jul 26, 2009
pymunk - 0.8.2 - Apr 22, 2009
pymunk - 0.8.1 - Nov 1, 2008
pymunk - 0.8 - Jun 15, 2008

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

November 8, 2010 10:31am - Victor Blomqvist - nickname: (viblo)
No, the installer should copy everything it needs on windows to the correct location. However, I haven't tested the installer on python 2.7, maybe it doesn't do what it should..

I will try to recreate the error and fix it, but as a workaround you should be able to use the source distribution. Either you can try to install it from there, just unzip and run python setup.py install

Or you can put the whole pymunk folder (the one with chipmunk.dll, _chipmunk.py and other files) in your application folder so your app can find it. pymunk doesnt really need to be installed, it works just as good to put the whole pymunk folder together with your other code files as a lib.

On python 3+ the setup script wont work, but iirc everything else should work, just copy the whole pymunk folder like described above.
November 1, 2010 2:51am - Jonathon - nickname: (prosper)
I am unable to import pymunk in 2.7 and 3.1.2. Output from Python Shell (2.7) is below. Am I supposed to have Chipmunk in a certain location prior to running the installer?

I am running Windows XP SP 2 in Microsoft Virtual PC 2007. I assume there is something rudimentary I am not doing as I can't seem to find anyone else with the same problem :)

>>> import pymunk
Loading chipmunk for Windows (32bit) [C:\Python27\lib\site-packages\pymunk\chipmunk.dll]

Failed to load pymunk library."

...

"Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pymunk
File "C:\Python27\lib\site-packages\pymunk\__init__.py", line 48, in <module>
import pymunk._chipmunk as cp
File "C:\Python27\lib\site-packages\pymunk\_chipmunk.py", line 8, in <module>
chipmunk_lib = load_library("chipmunk", print_path=_lib_debug)
File "C:\Python27\lib\site-packages\pymunk\libload.py", line 68, in load_library
lib = platform_specific_functions()['library_loader'].LoadLibrary(libfn)
File "C:\Python27\lib\ctypes\__init__.py", line 431, in LoadLibrary
return self._dlltype(name)
File "C:\Python27\lib\ctypes\__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found"

August 16, 2009 11:22pm - Ian Mallett - nickname: (geometrian)
Oh there they are...wonder why I didn't see them before; I downloaded the source last time. Impressive demos.
July 28, 2009 3:30pm - Victor Blomqvist - nickname: (viblo)
They are as in the previous releases included in the source release. I should mention it somewhere. But I don't think they have been updates from the previous (0.8.2) because there were no breaking api changes in this version. I don't expect any large changes of pymunk until slembcke releases a new Chipmunk version (or the chipmunk svn trunk has stabilized)
July 26, 2009 9:42pm - Ian Mallett - nickname: (geometrian)
Where are the examples in this release?
July 26, 2009 9:49am - Victor Blomqvist - nickname: (viblo)
With some testing and help from the comments here and in google code I found that it depends if the dll is compiled with help from python 2.5 or 2.6. In the latest release (0.8.3) I recompiled it with python25 build_chipmunk instead of python26, and now it only depends on msvcr71 which almost everyone should have.
April 28, 2009 1:35pm - Victor Blomqvist - nickname: (viblo)
geometrian: Strange. It works just fine on my own machine with Vista (but python 2.6 and visual studio and other dev tools installed). Someone reported the msvcr90.dll dependency to the issuetracker, so I wonder if somehting has changed since the last release or if its just coincidence and that it has always required msvcr90.dll? Anyway I will look into it and see if I can figure out whats wrong and if that dll is really needed.
April 23, 2009 6:46pm - Claudio Canepa - nickname: (claxo)
just FYI, working ok in winXP + sp3, python 2.6.1, pymunk 0.8.2 binary installer
April 23, 2009 2:21am - Ian Mallett - nickname: (geometrian)
It complained about needing msvcr90.dll, which I installed. It then gave me: http://img4.imageshack.us/img4/2505/image1yxf.png
Vista, 32 bit, Python 2.5.4
November 6, 2008 2:03pm - Victor Blomqvist - nickname: (viblo)
You don't need to compile anything on windows or in the normal *nix case. Otherwise you will need to compile chipmunk (python setup.py build_chipmunk). It should be easy on most platforms as it doesnt depend on anything special, and compiles fine with for example gcc. Unfortunately I don't have a computer with OSX, but if someone sends me the compiled dylib file I will add it to the package.
November 6, 2008 12:20pm - Dylan J. Raub - nickname: (dylanjraub)
Does this need compiling, as well?
November 2, 2008 10:57pm - Steven Sproat - nickname: (sproaty) - 5/5
This is amazing, wow! I ran through the demo and was very impressd, great work.
November 2, 2008 6:36am - Victor Blomqvist - nickname: (viblo)
It should install on both 2.5 and 2.6.
November 1, 2008 9:18pm - Claudio Canepa - nickname: (claxo)
The windows release is for a specific python version ?
June 25, 2008 1:28pm - Victor Blomqvist - nickname: (viblo)
geometrian: I think this is a problem I already know of: Its a bug/feature with python before version 2.5.2 which prevents the platform identification code pymunk uses to understand that you are on windows. You can either upgrade your python version or get the latest svn version of pymunk (Ive added a workaround) to fix the problem.
June 25, 2008 11:13am - Victor Blomqvist - nickname: (viblo)
pymike: Thanks for the bug report. I have updated and fixed demo_playground in svn (both this problem and another one with the mouse collision).
June 23, 2008 9:11am - pymike - nickname: (pymike)
In demo_playground.py after playing a while I got:

Vec2d(180.0, 122.0)
Traceback (most recent call last):
File "C:\Documents and Settings\Michael\Desktop\pymunk-0.8\pymunk-0.8\examples\demo_playground.py", line 339, in <module>
main()
File "C:\Documents and Settings\Michael\Desktop\pymunk-0.8\pymunk-0.8\examples\demo_playground.py", line 334, in main
demo.run()
File "C:\Documents and Settings\Michael\Desktop\pymunk-0.8\pymunk-0.8\examples\demo_playground.py", line 144, in run
self.loop()
File "C:\Documents and Settings\Michael\Desktop\pymunk-0.8\pymunk-0.8\examples\demo_playground.py", line 250, in loop
self.poly_points = u.convex_hull(self.poly_points)
File "c:\python25\lib\site-packages\pymunk-0.8-py2.5.egg\pymunk\util.py", line 109, in convex_hull
hull = [p0, points[1]]
IndexError: list index out of range
June 22, 2008 4:59pm - Ian Mallett - nickname: (geometrian)
I got:
Traceback (most recent call last):
File "C:\Users\Ian\Desktop\Physformer\PixelPuss.py", line 6, in <module>
import pymunk
File "c:\dev\python25\lib\site-packages\pymunk-0.8-py2.5-win32.egg\pymunk\__init__.py", line 14, in <module>
import _chipmunk as cp
File "c:\dev\python25\lib\site-packages\pymunk-0.8-py2.5-win32.egg\pymunk\_chipmunk.py", line 8, in <module>
chipmunk_lib = load_library("chipmunk", print_path=_lib_debug)
File "c:\dev\python25\lib\site-packages\pymunk-0.8-py2.5-win32.egg\pymunk\libload.py", line 33, in load_library
libfn = os.path.join(path, libfn)
UnboundLocalError: local variable 'libfn' referenced before assignment
June 22, 2008 10:06am - pymike - nickname: (pymike)
Awesome! I'm deving a couple games with this right now :-)
June 18, 2008 6:25pm - Victor Blomqvist - nickname: (viblo)
If you give me the error I might be able to better pinpoint the error and help you, but try to compile chipmunk. You do that with <pre>python setup.py build_chipmunk</pre> from the folder where setup.py, README.txt and others are. (If you are on windows and you use Vista you could try to upgrade python to 2.5.2)
June 18, 2008 3:05pm - Dylan J. Raub - nickname: (dylanjraub)
The sorce code won't work. I think it said something in the README file that i'd need to compile the whatsits and doo-dads? Why won't it work?
June 17, 2008 3:29pm - Dylan J. Raub - nickname: (dylanjraub)
Dude, I hate you and love you at the same time! I was going to make something almost identical to what you made!!! HOW DARE YOU!

However, you've saved me plenty of time by creating this, too.
Thanks ( I-I think...)
June 16, 2008 12:21pm - Francesco Mastellone - nickname: (effeemme)
That's very good news! I always liked the original Chipmunk, and having it well-ported to Python is a great thing. It's a very good match with pygame!!!
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Nov 13, 2014

Nov 11, 2014


Nov 10, 2014

Nov 9, 2014

Nov 6, 2014


Nov 4, 2014

Nov 3, 2014

Oct 28, 2014

Oct 21, 2014

Oct 16, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)