This building from source documentation is likely out-of-date.
Please consider using conda and installing via conda-forge.
-
Download and install the latest version of SWIG (preferably 3.0+) with your package manager.
If you are using Ubuntu, you can install it via Synaptic Package Manager (package name 'swig'). You will also need to install the python-dev package, and build-essential. Finally, you'll need python-pygame if you want to run the testbed.
$ sudo apt-get install build-essential python-dev swig python-pygame git
-
Clone the git repository
$ git clone https://github.com/pybox2d/pybox2d
-
Build and install the pybox2d library
$ python setup.py build # Assuming everything goes well... $ sudo python setup.py install
-
Install MinGW and then MSYS so that you can compile Box2D and pybox2d. Alternatively, install the correct version of Microsoft Visual Studio for your version of Python.
-
Install SWIG for making the Python wrapper. Install it in a location in your PATH, or add the SWIG directory to your PATH.
-
Clone the source from the git repository:
$ git clone https://github.com/pybox2d/pybox2d
-
Run MSYS and locate your pybox2d directory
$ cd /c/path/to/pybox2d
-
Build and install pybox2d
$ python setup.py build $ python setup.py install
-
Install homebrew from http://brew.sh/
-
Install SWIG, which wraps the C++ library. From a terminal window:
$ brew install swig
-
Clone the source from the git repository:
$ git clone https://github.com/pybox2d/pybox2d pybox2d_dev $ cd pybox2d_dev
-
Build and install pybox2d
$ python setup.py build # Assuming you're using either Python from conda or brew Python, # you should be able to install without superuser privileges: $ python setup.py install # For development purposes, it may be more convenient to do a develop # install instead $ python setup.py develop