pip install gym[box2d]报错

pip install gym[box2d]安装包时报错

 ERROR: Command errored out with exit status 1:
   command: 'E:\Anaconda\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\1\\AppData\\Local\\Temp\\pip-install-m2iryvg9\\box2d-py_52dd9735c0d04f18bffda3f9f8ccac52\\setup.py'"'"'; __file__='"'"'C:\\Users
\\1\\AppData\\Local\\Temp\\pip-install-m2iryvg9\\box2d-py_52dd9735c0d04f18bffda3f9f8ccac52\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setu
p()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\1\AppData\Local\Temp\pip-wheel-s0c49s0h'
       cwd: C:\Users\1\AppData\Local\Temp\pip-install-m2iryvg9\box2d-py_52dd9735c0d04f18bffda3f9f8ccac52\
  Complete output (16 lines):
  Using setuptools (version 58.0.4).
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  creating build\lib.win-amd64-3.9\Box2D
  copying library\Box2D\Box2D.py -> build\lib.win-amd64-3.9\Box2D
  copying library\Box2D\__init__.py -> build\lib.win-amd64-3.9\Box2D
  creating build\lib.win-amd64-3.9\Box2D\b2
  copying library\Box2D\b2\__init__.py -> build\lib.win-amd64-3.9\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
  ----------------------------------------
  ERROR: Failed building wheel for box2d-py

如下图所示:
pip install gym[box2d]报错_第1张图片
pip install gym[box2d]报错_第2张图片
解决办法:

pip3 install swig

pip install gym[box2d]报错_第3张图片

你可能感兴趣的:(debug记录,pip,python,开发语言,gym,解决报错)