Я запускаю mujoco-py в среде анаконды (в соответствии с пошаговой инструкцией по руководству ) и после вызова
python -c "import mujoco_py"
я получаю следующий результат:
C:\Users\Moritz>activate robotics
C:\Users\Moritz>conda.bat activate robotics
(robotics) C:\Users\Moritz>python -c "import mujoco_py"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg\mujoco_py\__init__.py", line 3, in <module>
from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg\mujoco_py\builder.py", line 510, in <module>
cymj = load_cython_ext(mujoco_path)
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg\mujoco_py\builder.py", line 79, in load_cython_ext
"set %s=%s;%%%s%%" % (var, lib_path, var))
Exception: Please add mujoco library to your PATH:
set PATH=C:\Users\Moritz\.mujoco\mjpro150\bin\bin;%PATH%
(robotics) C:\Users\Moritz>
Почему написано \ bin \ bin, хотя есть только одна папка bin, и мои пути:
После выполнения set PATH = C: \ Users \ Moritz.mujoco \ mjpro150 \ bin \ bin;% PATH% (я полагаю, что не в тот каталог) возникает эта ошибка:
running build_ext
building 'mujoco_py.cymj' extension
creating C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg\mujoco_py\generated\_pyxbld_2.0.2.9_37_windowsextensionbuilder\temp.win-amd64-3.7\Release\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg
Traceback (most recent call last):
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\distutils\dir_util.py", line 70, in mkpath
os.mkdir(head, mode)
FileNotFoundError: [WinError 206] Der Dateiname oder die Erweiterung ist zu lang: 'C:\\Users\\Moritz\\anaconda3\\envs\\robotics\\lib\\site-packages\\mujoco_py-2.0.2.9-py3.7.egg\\mujoco_py\\generated\\_pyxbld_2.0.2.9_37_windowsextensionbuilder\\temp.win-amd64-3.7\\Release\\Users\\Moritz\\anaconda3\\envs\\robotics\\lib\\site-packages\\mujoco_py-2.0.2.9-py3.7.egg'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg\mujoco_py\__init__.py", line 3, in <module>
from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg\mujoco_py\builder.py", line 510, in <module>
cymj = load_cython_ext(mujoco_path)
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg\mujoco_py\builder.py", line 105, in load_cython_ext
cext_so_path = builder.build()
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg\mujoco_py\builder.py", line 221, in build
built_so_file_path = self._build_impl()
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg\mujoco_py\builder.py", line 244, in _build_impl
dist.run_commands()
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg\mujoco_py\builder.py", line 144, in build_extensions
build_ext.build_extensions(self)
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions
_build_ext.build_ext.build_extensions(self)
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\distutils\command\build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\distutils\command\build_ext.py", line 534, in build_extension
depends=ext.depends)
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\distutils\_msvccompiler.py", line 320, in compile
sources, depends, extra_postargs)
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\distutils\ccompiler.py", line 348, in _setup_compile
self.mkpath(os.path.dirname(obj))
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\distutils\ccompiler.py", line 916, in mkpath
mkpath(name, mode, dry_run=self.dry_run)
File "C:\Users\Moritz\anaconda3\envs\robotics\lib\distutils\dir_util.py", line 74, in mkpath
"could not create '%s': %s" % (head, exc.args[-1]))
distutils.errors.DistutilsFileError: could not create 'C:\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg\mujoco_py\generated\_pyxbld_2.0.2.9_37_windowsextensionbuilder\temp.win-amd64-3.7\Release\Users\Moritz\anaconda3\envs\robotics\lib\site-packages\mujoco_py-2.0.2.9-py3.7.egg': Der Dateiname oder die Erweiterung ist zu lang
Я знаю, что есть люди с подобные проблемы, такие как здесь , но ни одно из их решений не работает для меня. Помимо этих ошибок, OpenAI Gym работает довольно хорошо, например, симуляции Card-Pole.
(mujoco200 заменен на mjpro150, потому что это последняя версия, предложенная на github для windows пользователей, но получила те же результаты)
ОС: Windows 10
Установлено: инструменты сборки c ++, anaconda3, Python 3.7.7