0

所以我正在尝试使用 d4rl 数据集(需要 mjoco 作为依赖项)。在安装 mojoco 并处理了 3 个小时的 Visual Studio 错误后,我得到了如帖子末尾所示的输出(运行下面的程序时)。

import gym
import d4rl 

env = gym.make('carla-town-v0')
dataset = env.get_dataset()

我很难理解这些错误。

我在 Windows 10 上运行所有东西并使用 python 3.7.7。我已经安装了 Visual Studio 2019、Visual Studio 2019 的构建工具、MSVC v142 x64/x86 和 Windows 10 SDK (10.0.20348.0)。

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\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py -IC:\Users\stefa\.mujoco\mujoco210\include -IC:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core\include -IC:\Users\stefa\AppData\Local\Programs\Python\Python37\include -IC:\Users\stefa\AppData\Local\Programs\Python\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\ATLMFC\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.20348.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\shared" /TcC:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c /FoC:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\generated\_pyxbld_2.1.2.14_37_windowsextensionbuilder\temp.win-amd64-3.7\Release\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.obj -fopenmp -w
cl : Command line warning D9025 : overriding '/W3' with '/w'
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
cymj.c
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(31932): error C2039: 'key_mpos': is not a member of '_mjModel'
C:\Users\stefa\.mujoco\mujoco210\include\mjmodel.h(554): note: see declaration of '_mjModel'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(31932): error C2198: '__pyx_f_9mujoco_py_4cymj__wrap_mjtNum_2d': too few arguments for call
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(31947): error C2039: 'key_mquat': is not a member of '_mjModel'
C:\Users\stefa\.mujoco\mujoco210\include\mjmodel.h(554): note: see declaration of '_mjModel'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(31947): error C2198: '__pyx_f_9mujoco_py_4cymj__wrap_mjtNum_2d': too few arguments for call
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(69984): error C2039: 'active2': is not a member of '_mjvPerturb'
C:\Users\stefa\.mujoco\mujoco210\include\mjvisualize.h(142): note: see declaration of '_mjvPerturb'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(69984): error C2198: '__Pyx_PyInt_From_int': too few arguments for call
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(70039): error C2039: 'active2': is not a member of '_mjvPerturb'
C:\Users\stefa\.mujoco\mujoco210\include\mjvisualize.h(142): note: see declaration of '_mjvPerturb'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(76594): error C2039: 'framergb': is not a member of '_mjvScene'
C:\Users\stefa\.mujoco\mujoco210\include\mjvisualize.h(252): note: see declaration of '_mjvScene'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(76594): error C2198: '__pyx_f_9mujoco_py_4cymj__wrap_float_1d': too few arguments for call
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(77301): error C2039: 'framewidth': is not a member of '_mjvScene'
C:\Users\stefa\.mujoco\mujoco210\include\mjvisualize.h(252): note: see declaration of '_mjvScene'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(77301): error C2198: '__Pyx_PyInt_From_int': too few arguments for call
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(77356): error C2039: 'framewidth': is not a member of '_mjvScene'
C:\Users\stefa\.mujoco\mujoco210\include\mjvisualize.h(252): note: see declaration of '_mjvScene'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(78736): error C2440: 'function': cannot convert from 'float [100]' to 'double'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(78791): error C2440: '=': cannot convert from 'float' to 'float [100]'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(78922): error C2039: 'legendoffset': is not a member of '_mjvFigure'
C:\Users\stefa\.mujoco\mujoco210\include\mjvisualize.h(288): note: see declaration of '_mjvFigure'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(78922): error C2198: '__Pyx_PyInt_From_int': too few arguments for call
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(78977): error C2039: 'legendoffset': is not a member of '_mjvFigure'
C:\Users\stefa\.mujoco\mujoco210\include\mjvisualize.h(288): note: see declaration of '_mjvFigure'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(79015): error C2039: 'subplot': is not a member of '_mjvFigure'
C:\Users\stefa\.mujoco\mujoco210\include\mjvisualize.h(288): note: see declaration of '_mjvFigure'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(79015): error C2198: '__Pyx_PyInt_From_int': too few arguments for call
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(79070): error C2039: 'subplot': is not a member of '_mjvFigure'
C:\Users\stefa\.mujoco\mujoco210\include\mjvisualize.h(288): note: see declaration of '_mjvFigure'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(79108): error C2039: 'highlightid': is not a member of '_mjvFigure'
C:\Users\stefa\.mujoco\mujoco210\include\mjvisualize.h(288): note: see declaration of '_mjvFigure'
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(79108): error C2198: '__Pyx_PyInt_From_int': too few arguments for call
C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\cymj.c(79163): error C2039: 'highlightid': is not a member of '_mjvFigure'
C:\Users\stefa\.mujoco\mujoco210\include\mjvisualize.h(288): note: see declaration of '_mjvFigure'
Traceback (most recent call last):
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\distutils\_msvccompiler.py", line 396, in compile
    self.spawn(args)
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\distutils\_msvccompiler.py", line 502, in spawn
    return super().spawn(cmd)
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\distutils\ccompiler.py", line 910, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\distutils\spawn.py", line 38, in spawn
    _spawn_nt(cmd, search_path, dry_run=dry_run)
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\distutils\spawn.py", line 81, in _spawn_nt
    "command %r failed with exit status %d" % (cmd, rc))
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 status 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "dataset.py", line 2, in <module>
    import d4rl
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\d4rl\__init__.py", line 14, in <module>
    import d4rl.locomotion
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\d4rl\locomotion\__init__.py", line 2, in <module>
    from d4rl.locomotion import ant
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\d4rl\locomotion\ant.py", line 20, in <module>
    import mujoco_py
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\__init__.py", line 2, in <module>
    from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\builder.py", line 504, in <module>
    cymj = load_cython_ext(mujoco_path)
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\builder.py", line 110, in load_cython_ext
    cext_so_path = builder.build()
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\builder.py", line 226, in build
    built_so_file_path = self._build_impl()
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\builder.py", line 249, in _build_impl
    dist.run_commands()
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py\builder.py", line 149, in build_extensions
    build_ext.build_extensions(self)
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 534, in build_extension
    depends=ext.depends)
  File "C:\Users\stefa\AppData\Local\Programs\Python\Python37\lib\distutils\_msvccompiler.py", line 398, 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 status 2
4

0 回答 0