EoinKenny / Prototype-Wrapper-Network-ICLR23

9 stars 4 forks source link

Could not build wheels for box2d-py, which is required to install pyproject.toml-based projects #1

Open ArpitSisodia opened 5 months ago

ArpitSisodia commented 5 months ago

Collecting box2d-py==2.3.5 (from gym[box2d]) Using cached box2d-py-2.3.5.tar.gz (374 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting pygame==2.1.0 (from gym[box2d]) Using cached pygame-2.1.0-cp310-cp310-macosx_11_0_arm64.whl.metadata (9.5 kB) Requirement already satisfied: swig==4.* in ./pwnet/lib/python3.10/site-packages (from gym[box2d]) (4.2.1) Using cached pygame-2.1.0-cp310-cp310-macosx_11_0_arm64.whl (4.8 MB) Using cached cloudpickle-3.0.0-py3-none-any.whl (20 kB) Using cached gym_notices-0.0.8-py3-none-any.whl (3.0 kB) 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 ╰─> [20 lines of output] Using setuptools (version 69.5.1). running bdist_wheel running build running build_py creating build creating build/lib.macosx-11.0-arm64-cpython-310 creating build/lib.macosx-11.0-arm64-cpython-310/Box2D copying library/Box2D/Box2D.py -> build/lib.macosx-11.0-arm64-cpython-310/Box2D copying library/Box2D/init.py -> build/lib.macosx-11.0-arm64-cpython-310/Box2D creating build/lib.macosx-11.0-arm64-cpython-310/Box2D/b2 copying library/Box2D/b2/init.py -> build/lib.macosx-11.0-arm64-cpython-310/Box2D/b2 running build_ext building 'Box2D._Box2D' extension swigging Box2D/Box2D.i to Box2D/Box2D_wrap.cpp swig -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 "/Users/esisarp/Documents/xrl/Prototype-Wrapper-Network-ICLR23/pwnet/bin/swig", line 5, in from swig import swig ModuleNotFoundError: No module named 'swig' error: command '/Users/esisarp/Documents/xrl/Prototype-Wrapper-Network-ICLR23/pwnet/bin/swig' 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

EoinKenny commented 5 months ago

Hi, thanks for reporting this issue.

I just cloned the repo, navigated to Car Racing, and then installed the environment as instructed on the readme, and ran python collect_data.py

I couldn't see this issue, I suppose it might have something to do with your setup. I am running a MacBook Pro Mac OS Monterey v 12.2.1, Apple M1 Pro

Gym can be a pain to setup, if it helps here is the environment as I see it now.

box2d-py==2.3.5
cloudpickle==3.0.0
filelock==3.13.4
fsspec==2024.3.1
gym==0.24.0
gym-notices==0.0.7
importlib_metadata==7.1.0
Jinja2==3.1.3
joblib==1.4.0
MarkupSafe==2.1.5
mpmath==1.3.0
networkx==3.2.1
numpy==1.26.4
pillow==10.3.0
pygame==2.1.0
scikit-learn==1.4.2
scipy==1.13.0
swig==4.2.1
sympy==1.12
threadpoolctl==3.4.0
toml==0.10.2
torch==2.2.2
torchaudio==2.2.2
torchvision==0.17.2
tqdm==4.66.2
typing_extensions==4.11.0
zipp==3.18.1
theaimer09 commented 3 months ago

I solve this question by pip install swig

EoinKenny commented 3 months ago

Great thank you for raising this!