当前位置:网站首页>安装mujoco报错:distutils.errors.DistutilsExecError: command ‘gcc‘ failed with exit status 1
安装mujoco报错:distutils.errors.DistutilsExecError: command ‘gcc‘ failed with exit status 1
2022-07-25 13:14:00 【抓紧爬起来不许摆烂】
1、 distutils.errors.DistutilsExecError: command ‘gcc‘ failed with exit status 1
如果你一开始就报错gcc的问题的话,可以尝试官方的解决方法:

翻译:
因为 mojoco_py 已经编译了需要链接到提供的 mujoco 二进制文件的本机代码,所以它在 linux 上的安装可能比纯 python 源包更具挑战性。
要在 ubuntu 上安装 mujoco-py,请确保安装了以下库:
sudo apt install libosmesa6-dev libgl1-mesa-glx libglfw3
如果安装了上述库,但仍然显示无法找到 -1GL 的错误,则很可能需要直接创建符号链接:
sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so
2、FileNotFoundError: [Errno 2] No such file or directory: ‘patchelf’: ‘patchelf’
正常的话,import mujoco_py不会报上面gcc错误了……而是,报另一个错误
FileNotFoundError: [Errno 2] No such file or directory: ‘patchelf’: ‘patchelf’
安装patchelf就可以解决
$ sudo apt-get update -y
$ sudo apt-get install -y patchelf
3、 ERROR: GLEW initalization error: Missing GL version’ & Missing path to your environment variable.
运行使用mujoco_py的代码时,如果有调用可视化窗口env.render(),可能会有如下报错
Creating window glfw
ERROR: GLEW initalization error: Missing GL version
解决方法为:
先安装package
$ sudo apt-get install libglew-dev
(可能会出现依赖项无法安装等等,同上依次手动安装)
然后在~/.bashrc文件中添加如下路径
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so
然后在终端
$ source ~/.bashrc
如此,便可以在终端运行相关程序代码。
但是如果在pycharm中,可能还是会报错,它不会识别调用该路径,包括安装的mujoco_210的路径也无法识别调用,会报错
Missing path to your environment variable.
Current values LD_LIBRARY_PATH=
Please add following line to .bashrc:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/dreamer/.mujoco/mujoco210/bin
需要手动添加路径,在pycharm中,
Run ——> Edit Configurations ——> Environment variables
然后,添加路径:
Name: LD_LIBRARY_PATH
Value: $LD_LIBRARY_PATH:/home/(用户名)/.mujoco/mujoco200/bin
Name: LD_PRELOAD
Value: /usr/lib/x86_64-linux-gnu/libGLEW.so
边栏推荐
- MLX90640 红外热成像仪测温传感器模块开发笔记(五)
- 【视频】马尔可夫链蒙特卡罗方法MCMC原理与R语言实现|数据分享
- 【AI4Code】《IntelliCode Compose: Code Generation using Transformer》 ESEC/FSE 2020
- OAuth, JWT, oidc, you mess me up
- Mlx90640 infrared thermal imager temperature sensor module development notes (V)
- Redis可视化工具RDM安装包分享
- 【CSDN 年终总结】结束与开始,一直在路上—— “1+1=王”的2021总结
- 并发编程之并发工具集
- 0710RHCSA
- Substance designer 2021 software installation package download and installation tutorial
猜你喜欢

【OpenCV 例程 300篇】239. Harris 角点检测之精确定位(cornerSubPix)

Memory layout of program

Any time, any place, super detective, seriously handle the case!

arm架构移植alsa-lib和alsa-utils一路畅通

基于百问网IMX6ULL_PRO开发板驱动AP3216实验
![[ai4code final chapter] alphacode: competition level code generation with alphacode (deepmind)](/img/05/86eed30a7c063beace400a005e4a4c.png)
[ai4code final chapter] alphacode: competition level code generation with alphacode (deepmind)

Jupyter Notebook介绍

0715RHCSA

【AI4Code】《IntelliCode Compose: Code Generation using Transformer》 ESEC/FSE 2020
![[today in history] July 25: IBM obtained the first patent; Verizon acquires Yahoo; Amazon releases fire phone](/img/f6/d422367483542a0351923f2df27347.jpg)
[today in history] July 25: IBM obtained the first patent; Verizon acquires Yahoo; Amazon releases fire phone
随机推荐
Error: cannot find or load main class XXXX
【OpenCV 例程 300篇】239. Harris 角点检测之精确定位(cornerSubPix)
网络空间安全 渗透攻防9(PKI)
Cv2.resize function reports an error: error: (-215:assertion failed) func= 0 in function ‘cv::hal::resize‘
int数组获取重复数据
ESP32-C3 基于Arduino框架下Blinker点灯控制10路开关或继电器组
【历史上的今天】7 月 25 日:IBM 获得了第一项专利;Verizon 收购雅虎;亚马逊发布 Fire Phone
Eccv2022 | transclassp class level grab posture migration
[today in history] July 25: IBM obtained the first patent; Verizon acquires Yahoo; Amazon releases fire phone
【CTR】《Towards Universal Sequence Representation Learning for Recommender Systems》 (KDD‘22)
我的创作纪念日
B树和B+树
Django 2 ----- database and admin
OAuth, JWT, oidc, you mess me up
【AI4Code】CodeX:《Evaluating Large Language Models Trained on Code》(OpenAI)
Migrate PaloAlto ha high availability firewall to panorama
How to solve the problem of taking up too much space when recording and editing videos?
并发编程之并发工具集
Arrays常用方法
如何用因果推断和实验驱动用户增长? | 7月28日TF67