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

  整个的报错记录如下:

>>> import mujoco_py
running build_ext
building 'mujoco_py.cymj' extension
gcc -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 -w
gcc -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 -w
gcc -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 -lGL
collect2: error: ld returned 1 exit status
Traceback (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 -lGL
collect2: error: ld returned 1 exit status

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

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

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

apt install libgl1-mesa-glx --reinstall

  重装一下之后就好了。

后续

  我还有尝试过:

https://github.com/cocodataset/cocoapi/issues/94

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

  1. error:command ‘gcc‘ failed with exit status 1 记录

    转载地址:http://www.laozuo.org/10700.html 在用pip安装Python库软件的时候遇到"command 'gcc' failed with exit stat ...

  2. 安装kerberos报错 error: command 'gcc' failed with exit status 1

    pip install kerberos 报错:error: command 'gcc' failed with exit status 1 安装环境工具 yum install gcc libffi ...

  3. 安装MySQL-python报错 error: command 'gcc' failed with exit status 1解决方法

    错误如: _mysql.c:2331: error: '_mysql_ConnectionObject' has no member named 'open' _mysql.c:2338: error ...

  4. 【吭】centos安装mysql报错OSError: mysql_config not found/error: command ‘gcc‘ failed with exit status 1

    问题:    OSError: mysql_config not found 解决:yum install mysql-devel 问题:error: command 'gcc' failed wit ...

  5. pip install scrpy 报错: command 'gcc' failed with exit status 1

    报错如下: copying src/twisted/words/xish/xpathparser.g -> build/lib.linux-x86_64-2.7/twisted/words/xi ...

  6. 安装oracle gcc版本,安装cx_Oracle时报错:error: command 'gcc' failed with exit status 1

    安装cx_Oracle时报错:error: command 'gcc' failed with exit status 1 发布时间:2020-06-19 21:27:36 来源:51CTO 阅读:1 ...

  7. python mysql gcc_MySQL-python “error: command 'gcc' failed with exit status 1”错误

    安装MySQL-python-1.2.3c1出现"error: command 'gcc' failed with exit status 1"错误 具体报错信息如下: _mysq ...

  8. 【Linux学习笔记】解决:error: command ‘gcc‘ failed with exit status 1

    报错: error: command 'gcc' failed with exit status 1 原因:缺少gcc,openssl-devel openssl-devel包是第三方软件开发时使用的 ...

  9. pycuda installation error: command 'gcc' failed with exit status 1

    原文:python采坑之路 Setup script exited with error: command 'gcc' failed with exit status 1 伴随出现"cuda ...

  10. error: command 'gcc' failed with exit status 1

    使用 pip install scrapy 安装 scrapy 时,提示error: command 'gcc' failed with exit status 1 解决方法: yum  -y  in ...

最新文章

  1. OpenCV运动检测跟踪(blob track)框架组成模块详解
  2. 关于自动驾驶,我们是否在刻意回避这三大关键问题?
  3. 移动端调试利器------微信开源项目
  4. python编程if语法-21天学习python编程_if语句
  5. ServletContextListener 解析用法
  6. 论文中怎么引用yolo_论文中怎么加入脚注,并且对脚注的序号、位置、格式进行调整...
  7. iOS12.4完整越狱来了,附手机端一键越狱教程!
  8. 浏览器中cookies查看_如何在任何浏览器中阻止Cookies(除了您使用的网站外)
  9. Tiktok shop小店注册以及如何一键上传产品批量上货铺货
  10. Briefings in bioinformatics2021 | MolGNet+:基于分子全局表征的高效自监督框架,用于药物发现
  11. 图形学数学基础之重要性采样(Importance Sampling)
  12. [4G5G专题-64]:RF层 - 无线电磁波的基本原理与传输特性
  13. Docker容器化实战第二课 镜像、容器、仓库详解
  14. 盘点2009年商场百货创意促销手段 秒杀当道
  15. 骑士VS热火直播NBA常规赛骑士VS热火直播12月3日骑士VS热火视频直播
  16. ESP32学习笔记(34)——BLE一主多从连接
  17. Redis-4-Java操作Redis
  18. AcWing 238. 银河英雄传说(C++)
  19. 旺旺消息上传到服务器,旺旺在线却发送不了消息怎么办
  20. Python字面量、注释、变量、数据类型、数据类型的转换、标识符、运算符、字符串扩展、字符串格式化、数据输入(input语句)

热门文章

  1. Eclipse RCP中Viewer交互的三种方式/Make your Eclipse applications richer with view linking
  2. 加密解密(源自Discuz!NT3.1)
  3. VBOX+WINDOWSSERVER208R2实现虚拟机内FTP服务器搭建
  4. NYOJ --21--三个水杯
  5. shell-6:shell中的计算$((1+1))
  6. MySql查询语句中解决“该列没有包含在聚合函数或者groupby子句中”的相关问题方法...
  7. Python脚本控制的WebDriver 常用操作 十八 获取测试对象的css属性
  8. 输入输出运算符的重载
  9. getdate() java_JAVA获得当前时间的几种方法
  10. Nginx源码分析 - Event事件篇 - Event模块和配置的初始化(16)