Windows 安装 box2d-kengz报错解决方案

报错如下

Building wheels for collected packages: box2d-kengz
  Building wheel for box2d-kengz (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.exit code: 1
  ╰─> [16 lines of output]
      Using setuptools (version 66.0.0).
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-38
      creating build\lib.win-amd64-cpython-38\Box2D
      copying library\Box2D\Box2D.py -> build\lib.win-amd64-cpython-38\Box2D
      copying library\Box2D\__init__.py -> build\lib.win-amd64-cpython-38\Box2D
      creating build\lib.win-amd64-cpython-38\Box2D\b2
      copying library\Box2D\b2\__init__.py -> build\lib.win-amd64-cpython-38\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
      error: command 'swig.exe' failed: None
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for box2d-kengz
  Running setup.py clean for box2d-kengz
Failed to build box2d-kengz
Installing collected packages: box2d-kengz
  Running setup.py install for box2d-kengz ... error
  error: subprocess-exited-with-error

  × Running setup.py install for box2d-kengz did not run successfully.exit code: 1
  ╰─> [18 lines of output]
      Using setuptools (version 66.0.0).
      running install
      D:\Anaconda3\envs\RL\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-38
      creating build\lib.win-amd64-cpython-38\Box2D
      copying library\Box2D\Box2D.py -> build\lib.win-amd64-cpython-38\Box2D
      copying library\Box2D\__init__.py -> build\lib.win-amd64-cpython-38\Box2D
      creating build\lib.win-amd64-cpython-38\Box2D\b2
      copying library\Box2D\b2\__init__.py -> build\lib.win-amd64-cpython-38\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
      error: command 'swig.exe' failed: None
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> box2d-kengz

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

可以看到这是没有swig.exe导致的:
在这里插入图片描述

解决方案

安装swig:官网:https://www.swig.org/download.html

可以参考:《Win10下安装swig

swig-win-4.1.1.zip分享:

链接:https://pan.baidu.com/s/1bCw9GeM7q_1PEQuPkk0zzQ?pwd=2srk
提取码:2srk

安装完swig后,成功安装box2d-kengz:
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Goafan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值