安装 stable-baselines3[extra] 和 gym[all] 时出现问题

问题描述 投票:0回答:1

我想在 vs code 中安装 stable-baselines3[extra] 和 gym[all] 但我得到这些错误:

pip 安装健身房[全部]

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
╰─> [16 lines of output]
  Using setuptools (version 67.7.2).
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-310
  creating build\lib.win-amd64-cpython-310\Box2D
  copying library\Box2D\Box2D.py -> build\lib.win-amd64-cpython- 
  310\Box2D
  copying library\Box2D\__init__.py -> build\lib.win-amd64-cpython- 
  310\Box2D
  creating build\lib.win-amd64-cpython-310\Box2D\b2
  copying library\Box2D\b2\__init__.py -> build\lib.win-amd64- 
  cpython-310\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-py
  Failed to build box2d-py
  ERROR: Could not build wheels for box2d-py, which is required 
  to 
  install pyproject.toml-based projects

pip 安装稳定基线3[额外]

  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
  error in gym setup command: 'extras_require' must be a dictionary 
  whose values are strings or lists of strings containing valid 
  project/version requirement specifiers.
  [end of output]

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

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

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

我已经尝试过:

pip install swig
没有任何成功。我该如何解决?我已经尝试将它们安装在 Jupyter Notebook 和 Spyder 上以及三台不同的电脑上,但没有任何效果。如果有人能帮助我,我将不胜感激。

python visual-studio-code install.packages
1个回答
1
投票

Stable Baselines示例笔记本所示,您可以使用:

!pip install "stable-baselines3[extra]>=2.0.0a4"
© www.soinside.com 2019 - 2024. All rights reserved.