This library is used in the OpenAI Gym package, which is often used for reinforcement learning of Python.
https://pypi.org/project/box2d-py/
Installing this package in a Windows environment can be a daunting task. I also suffered from the following error:
swig.exe -python -c++ -IBox2D -small -O -includeall -ignoremissing -w201 -globals b2Globals -outdir library\Box2D -keyword -w511 -D_SWIG_KWARGS -o Box2D\Box2D_wrap.cpp Box2D\Box2D.i
Box2D\Box2D.i(44) : Error: Unknown directive '%exception'.
Installing with conda seems to be the quickest way to avoid problems on Windows, but it's a bit of a hurdle for me who doesn't use conda. I created a Wheel file so that it can be easily installed with pip. Please use this wheel file before installing gym [all] etc.
Download the wheel file for your Python environment and install box2d-py with the wheel file.
https://github.com/kitfactory/box2d-py-wheel
> pip install box2d_py-2.3.8-cp38-cp38m-win_amd64.whl
> pip install box2d_py-2.3.8-cp37-cp37m-win_amd64.whl
> pip install box2d_py-2.3.8-cp36-cp36m-win_amd64.whl
Recommended Posts