700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 安装mujoco报错:distutils.errors.DistutilsExecError: command ‘gcc‘ failed with exit status 1

安装mujoco报错:distutils.errors.DistutilsExecError: command ‘gcc‘ failed with exit status 1

时间:2021-12-23 07:46:24

相关推荐

安装mujoco报错:distutils.errors.DistutilsExecError: command ‘gcc‘ failed with exit status 1

如果你一开始就报错gcc的问题的话,我建议你首先看官方的解决办法:

整个的报错记录如下:

>>> import mujoco_pyrunning build_extbuilding 'mujoco_py.cymj' extensiongcc -pthread -B /home/hzq/anaconda3/envs/TianChi/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ianaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py -I/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py -I/home/hzq/.mujoco/mujoco200/include -I/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/numpy/core/include -I/home/hzq/anaconda3/envs/TianChi/include/python3.6m -c /home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/cymj.c -o /home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/generated/_pyxbld_2.0.2.13_36_linuxcpuextensionbuilder/temp.linux-x86_64-3.6/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/cymj.o -fopenmp -wgcc -pthread -B /home/hzq/anaconda3/envs/TianChi/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ianaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py -I/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py -I/home/hzq/.mujoco/mujoco200/include -I/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/numpy/core/include -I/home/hzq/anaconda3/envs/TianChi/include/python3.6m -c /home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/gl/osmesashim.c -o /home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/generated/_pyxbld_2.0.2.13_36_linuxcpuextensionbuilder/temp.linux-x86_64-3.6/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/gl/osmesashim.o -fopenmp -wgcc -pthread -shared -B /home/hzq/anaconda3/envs/TianChi/compiler_compat -L/home/hzq/anaconda3/envs/TianChi/lib -Wl,-rpath=/home/hzq/anaconda3/envs/TianChi/lib -Wl,--no-as-needed -Wl,--sysroot=/ /home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/generated/_pyxbld_2.0.2.13_36_linuxcpuextensionbuilder/temp.linux-x86_64-3.6/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/cymj.o /home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/generated/_pyxbld_2.0.2.13_36_linuxcpuextensionbuilder/temp.linux-x86_64-3.6/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/gl/osmesashim.o -L/home/hzq/.mujoco/mujoco200/bin -Wl,-R/home/hzq/.mujoco/mujoco200/bin -lmujoco200 -lglewosmesa -lOSMesa -lGL -o /home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/generated/_pyxbld_2.0.2.13_36_linuxcpuextensionbuilder/lib.linux-x86_64-3.6/mujoco_py/cymj.cpython-36m-x86_64-linux-gnu.so -fopenmp/home/hzq/anaconda3/envs/TianChi/compiler_compat/ld: cannot find -lGLcollect2: error: ld returned 1 exit statusTraceback (most recent call last):File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/distutils/unixccompiler.py", line 197, in linkself.spawn(linker + ld_args)File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/distutils/ccompiler.py", line 909, in spawnspawn(cmd, dry_run=self.dry_run)File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/distutils/spawn.py", line 36, in spawn_spawn_posix(cmd, search_path, dry_run=dry_run)File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix% (cmd, exit_status))distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1During handling of the above exception, another exception occurred:Traceback (most recent call last):File "<stdin>", line 1, in <module>File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/__init__.py", line 3, in <module>from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoExceptionFile "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/builder.py", line 510, in <module>cymj = load_cython_ext(mujoco_path)File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/builder.py", line 105, in load_cython_extcext_so_path = builder.build()File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/builder.py", line 221, in buildbuilt_so_file_path = self._build_impl()File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/builder.py", line 273, in _build_implso_file_path = super()._build_impl()File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/builder.py", line 244, in _build_impldist.run_commands()File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/distutils/dist.py", line 955, in run_commandsself.run_command(cmd)File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/distutils/dist.py", line 974, in run_commandcmd_obj.run()File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run_build_ext.build_ext.run(self)File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/distutils/command/build_ext.py", line 339, in runself.build_extensions()File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/mujoco_py-2.0.2.13-py3.6.egg/mujoco_py/builder.py", line 144, in build_extensionsbuild_ext.build_extensions(self)File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions_build_ext.build_ext.build_extensions(self)File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensionsself._build_extensions_serial()File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serialself.build_extension(ext)File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/distutils/command/build_ext.py", line 558, in build_extensiontarget_lang=language)File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/distutils/ccompiler.py", line 717, in link_shared_objectextra_preargs, extra_postargs, build_temp, target_lang)File "/home/hzq/anaconda3/envs/TianChi/lib/python3.6/distutils/unixccompiler.py", line 199, in linkraise LinkError(msg)distutils.errors.LinkError: command 'gcc' failed with exit status 1

这里我就定位到:

/home/hzq/anaconda3/envs/TianChi/compiler_compat/ld: cannot find -lGLcollect2: error: ld returned 1 exit status

然后看gcc报错,参考这篇帖子:/ContinuumIO/anaconda-issues/issues/11152

rename /home/eva/miniconda3/compiler_compat/ld to ld_old. or just delete it.

把这个什么ld给重命名了,发现还是没啥用。然后又看issue:/openai/mujoco-py/issues/374。发现需要重装

apt install libgl1-mesa-glx --reinstall

重装一下之后就好了。

后续

我还有尝试过:

/cocodataset/cocoapi/issues/94

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。