--- id: pymunk version: "7.3.0" license: MIT license_treatment: permissive maintenance: active --- # pymunk — Pymunk is a easy-to-use pythonic 2D physics library License: permissive · Maintenance: active · Downloads: 379.1K/mo ## What it is and what it does Pymunk wraps the Chipmunk2D physics engine in a Pythonic API, letting you simulate 2D rigid bodies, collisions, and constraints without writing C code. You create a Space (simulation container), add bodies with shapes, set gravity and other properties, then step the simulation forward in time. It's designed to integrate with game frameworks or run standalone for physics demos and scientific simulations. The library has been actively maintained since 2007 and is used in published research, game competition winners, and autonomous vehicle simulations. It requires Python 3.9 or later and depends only on cffi; binary wheels are available for Windows, macOS, and Linux on multiple architectures, making installation straightforward via pip. Use it for: - Add realistic gravity, collisions, and rigid body dynamics to a game without implementing physics from scratch - Simulate mechanical systems, pendulums, or constraint-based structures for research or educational demonstrations - Prototype 2D physics interactions in a notebook or standalone script for algorithm validation - Build interactive physics sandboxes where users can create and manipulate bodies and constraints in real time - Test collision detection and response logic for game level design or agent navigation ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Pymunk is a 2D rigid body physics simulation library for Python, providing collision detection, body dynamics, and constraint solving built on the Chipmunk2D engine. Yes. Pymunk is a mature, actively maintained library with no known vulnerabilities, permissive MIT licensing, and a single lightweight dependency. Install friction is medium but manageable via prebuilt wheels. It is the right choice if you need 2D rigid body physics in Python—especially for games or simulations—and want to avoid implementing collision and constraint solvers yourself. ## Install pip install pymunk uv add pymunk poetry add pymunk ## Installing pymunk Before you install: Medium install friction due to compiled wheels for multiple platforms and Python versions. Active maintenance with recent release (58 days ago) and 1062 repository stars. Single runtime dependency (cffi) is lightweight. License in practice: MIT license permits commercial and private use with minimal restrictions—suitable for games, simulations, and research projects without licensing concerns. Quickstart: pip install pymunk import pymunk space = pymunk.Space() space.gravity = 0, -981 body = pymunk.Body() body.position = 50, 100 poly = pymunk.Poly.create_box(body) poly.mass = 10 space.add(body, poly) space.step(0.02) Requires Python 3.9 or later; binary wheels available for common platforms, but compilation from source requires a C compiler. Verify before relying: - Whether performance is suitable for real-time game loops at typical frame rates - Stability and API compatibility guarantees across minor version updates - Whether constraint types and joint options cover specific simulation needs ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 379.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags 2d physics simulation python, rigid body physics library, collision detection 2d, game physics engine, pymunk chipmunk, 2d physics games, physics constraints solver, game-physics, simulation, 2d-graphics [View on SkillFed](https://skillfed.io/packages/pymunk) · [View on PyPI](https://pypi.org/project/pymunk/)