skip to Main Content
C:UsersAdministrator>pip install gymnasium[box2d]
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [40 lines of output]
      Using setuptools (version 68.0.0).
      running bdist_wheel
      running build
      running build_py
      creating build
      creating buildlib.win-amd64-cpython-311
      creating buildlib.win-amd64-cpython-311Box2D
      copying libraryBox2DBox2D.py -> buildlib.win-amd64-cpython-311Box2D
      copying libraryBox2D__init__.py -> buildlib.win-amd64-cpython-311Box2D
      creating buildlib.win-amd64-cpython-311Box2Db2
      copying libraryBox2Db2__init__.py -> buildlib.win-amd64-cpython-311Box2Db2
      running build_ext
      building 'Box2D._Box2D' extension
      swigging Box2DBox2D.i to Box2DBox2D_wrap.cpp
      swig.exe -python -c++ -IBox2D -small -O -includeall -ignoremissing -w201 -globals b2Globals -outdir libraryBox2D -keyword -w511 -D_SWIG_KWARGS -o Box2DBox2D_wrap.cpp Box2DBox2D.i
      Box2DCommonb2Math.h(67) : Warning 302: Identifier 'b2Vec2' redefined by %extend (ignored),
      Box2DBox2D_math.i(47) : Warning 302: %extend definition of 'b2Vec2'.
      Box2DCommonb2Math.h(158) : Warning 302: Identifier 'b2Vec3' redefined by %extend (ignored),
      Box2DBox2D_math.i(168) : Warning 302: %extend definition of 'b2Vec3'.
      Box2DCommonb2Math.h(197) : Warning 302: Identifier 'b2Mat22' redefined by %extend (ignored),
      Box2DBox2D_math.i(301) : Warning 302: %extend definition of 'b2Mat22'.
      Box2DCommonb2Math.h(271) : Warning 302: Identifier 'b2Mat33' redefined by %extend (ignored),
      Box2DBox2D_math.i(372) : Warning 302: %extend definition of 'b2Mat33'.
      Box2DCollisionb2DynamicTree.h(44) : Warning 312: Nested union not currently supported (ignored).
      Box2DCommonb2Settings.h(144) : Warning 506: Can't wrap varargs with keyword arguments enabled
      Box2DCommonb2Math.h(91) : Warning 509: Overloaded method b2Vec2::operator ()(int32) effectively ignored,
      Box2DCommonb2Math.h(85) : Warning 509: as it is shadowed by b2Vec2::operator ()(int32) const.
      creating buildtemp.win-amd64-cpython-311
      creating buildtemp.win-amd64-cpython-311Release
      creating buildtemp.win-amd64-cpython-311ReleaseBox2D
      creating buildtemp.win-amd64-cpython-311ReleaseBox2DCollision
      creating buildtemp.win-amd64-cpython-311ReleaseBox2DCollisionShapes
      creating buildtemp.win-amd64-cpython-311ReleaseBox2DCommon
      creating buildtemp.win-amd64-cpython-311ReleaseBox2DDynamics
      creating buildtemp.win-amd64-cpython-311ReleaseBox2DDynamicsContacts
      creating buildtemp.win-amd64-cpython-311ReleaseBox2DDynamicsJoints
      "C:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.37.32822binHostX86x64cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:UsersAdministratoranaconda3include -IC:UsersAdministratoranaconda3Include "-IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.37.32822include" "-IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCAuxiliaryVSinclude" "-IC:Program Files (x86)Windows Kits10Include10.0.22621.0ucrt" /EHsc /TpBox2DBox2D_wrap.cpp /Fobuildtemp.win-amd64-cpython-311ReleaseBox2DBox2D_wrap.obj -I.
      Box2D_wrap.cpp
      C:UsersAdministratoranaconda3includepyconfig.h(207): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
      error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe' failed with exit code 2
      [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
ERROR: Could not build wheels for box2d-py, which is required to install pyproject.toml-based projects

I have tried pip install swig wheel
swig version = 4.1.1
wheel version = 0.41.2

microsft visual studio 2022 comunity version also c++ development and windows 11 SDK installed

2

Answers


  1. Chosen as BEST ANSWER

    below commands fix my error. I had try on Ubuntu machine

    requirments:

    Python 3.10.9
    pip 23.2.1
    

    step 1: install wsl

    wsl --install
    

    step 2: Install Anaconda run below command

    cd /tmp
    curl -O https://repo.anaconda.com/archive/Anaconda3-2023.03-1-Linux-x86_64.sh
    source Anaconda3-2023.03-1-Linux-x86_64.sh
    

    step 3: Clone Finrl

    git clone https://github.com/AI4Finance-Foundation/FinRL.git
    

    step 4:

    cd Finrl
    pip install .
    

    it will install all the dependency.


  2. To compile box2d-py on windows, you’ll need the lasest windows sdk installed on your machine. You can get it here.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search