运行Windows10Python3.10,尝试运行OpenAI Gym类人示例:humanoid.py
怀疑与Cython和C编译器有关。
PS C:\mayhem\gym\gym\envs\mujoco> python .\humanoid.py
C:\Users\Joe\AppData\Local\Programs\Python\Python310\lib\site-packages\mujoco_py\builder.py:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
import distutils
C:\Users\Joe\AppData\Local\Programs\Python\Python310\lib\site-packages\mujoco_py\builder.py:9: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
from distutils.sysconfig import customize_compiler
running build_ext
building 'mujoco_py.cymj' extension
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Joe\AppData\Local\Programs\Python\Python310\lib\site-packages\mujoco_py -IC:\Users\Joe\.mujoco\mujoco210\include -IC:\Users\Joe\AppData\Local\Programs\Python\Python310\lib\site-packages\numpy\core\include -IC:\Users\Joe\AppData\Local\Programs\Python\Python310\include -IC:\Users\Joe\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /TcC:\Users\Joe\AppData\Local\Programs\Python\Python310\lib\site-packages\mujoco_py/gl/dummyshim.c /FoC:\Users\Joe\AppData\Local\Programs\Python\Python310\lib\site-packages\mujoco_py\generated\_pyxbld_2.1.2.14_310_windowsextensionbuilder\temp.win-amd64-3.10\Release\Users\Joe\AppData\Local\Programs\Python\Python310\lib\site-packages\mujoco_py/gl/dummyshim.obj -fopenmp -w
cl : Command line warning D9025 : overriding '/W3' with '/w'
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
dummyshim.c
C:\Users\Joe\AppData\Local\Programs\Python\Python310\lib\site-packages\mujoco_py\gl\glshim.h(4): fatal error C1083: Cannot open include file: 'mujoco.h': No such file or directory
Traceback (most recent call last):
File "C:\Users\Joe\AppData\Local\Programs\Python\Python310\lib\distutils\_msvccompiler.py", line 401, in compile
self.spawn(args)
File "C:\Users\Joe\AppData\Local\Programs\Python\Python310\lib\distutils\_msvccompiler.py", line 507, in spawn
return super().spawn(cmd)
File "C:\Users\Joe\AppData\Local\Programs\Python\Python310\lib\distutils\ccompiler.py", line 910, in spawn
spawn(cmd, dry_run=self.dry_run)
File "C:\Users\Joe\AppData\Local\Programs\Python\Python310\lib\distutils\spawn.py", line 91, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\mayhem\gym\gym\envs\mujoco\humanoid.py", line 4, in <module>
from gym.envs.mujoco import MuJocoPyEnv
...
File "C:\Users\Joe\AppData\Local\Programs\Python\Python310\lib\distutils\_msvccompiler.py", line 403, in compile
raise CompileError(msg)
distutils.errors.CompileError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
https://stackoverflow.com/questions/73324036
复制相似问题