Why does my installation of box2d fail even though I already have swig installed

93 views Asked by At

Requirement already satisfied: gymnasium[box2d] in c:\python\lib\site-packages (0.29.1) Requirement already satisfied: numpy>=1.21.0 in c:\python\lib\site-packages (from gymnasium[box2d]) (1.25.1) Requirement already satisfied: cloudpickle>=1.2.0 in c:\python\lib\site-packages (from gymnasium[box2d]) (2.2.1) Requirement already satisfied: typing-extensions>=4.3.0 in c:\python\lib\site-packages (from gymnasium[box2d]) (4.8.0) Requirement already satisfied: farama-notifications>=0.0.1 in c:\python\lib\site-packages (from gymnasium[box2d]) (0.0.4) Collecting box2d-py==2.3.5 (from gymnasium[box2d]) Using cached box2d-py-2.3.5.tar.gz (374 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting pygame>=2.1.3 (from gymnasium[box2d]) Obtaining dependency information for pygame>=2.1.3 from https://files.pythonhosted.org/packages/82/61/93ae7afbd931a70510cfdf0a7bb0007540020b8d80bc1d8762ebdc46479b/pygame-2.5.2-cp311-cp311-win_amd64.whl.metadata Using cached pygame-2.5.2-cp311-cp311-win_amd64.whl.metadata (13 kB) Requirement already satisfied: swig==4.* in c:\python\lib\site-packages (from gymnasium[box2d]) (4.1.1) Using cached pygame-2.5.2-cp311-cp311-win_amd64.whl (10.8 MB) Building wheels for collected packages: box2d-py Building wheel for box2d-py (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for box2d-py (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [21 lines of output] Using setuptools (version 68.2.2). running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-311 creating build\lib.win-amd64-cpython-311\Box2D copying library\Box2D\Box2D.py -> build\lib.win-amd64-cpython-311\Box2D copying library\Box2D_init_.py -> build\lib.win-amd64-cpython-311\Box2D creating build\lib.win-amd64-cpython-311\Box2D\b2 copying library\Box2D\b2_init_.py -> build\lib.win-amd64-cpython-311\Box2D\b2 running build_ext building 'Box2D._Box2D' extension swigging Box2D\Box2D.i to Box2D\Box2D_wrap.cpp 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 Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in run_code File "C:\python\Scripts\swig.exe_main.py", line 4, in ModuleNotFoundError: No module named 'swig' error: command 'C:\python\Scripts\swig.exe' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for box2d-py Failed to build box2d-py ERROR: Could not build wheels for box2d-py, which is required to install pyproject.toml-based projects

---stuck here, any suggestion welcome! thanks a lot

when I ran the command as 'pip install gymnasium[box2d]', the error pop up

0

There are 0 answers