当前位置:网站首页>安装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
边栏推荐
- 为提高效率使用ParallelStream竟出现各种问题
- 手写jdbc的使用步骤?
- massCode 一款优秀的开源代码片段管理器
- [CSDN year-end summary] end and start, always on the way - "2021 summary of" 1+1= Wang "
- Esp32-c3 is based on blinker lighting control 10 way switch or relay group under Arduino framework
- 【AI4Code】CodeX:《Evaluating Large Language Models Trained on Code》(OpenAI)
- Migrate PaloAlto ha high availability firewall to panorama
- 错误: 找不到或无法加载主类 xxxx
- 并发编程 — 内存模型 JMM
- 录制和剪辑视频,如何解决占用空间过大的问题?
猜你喜欢

Chapter5 : Deep Learning and Computational Chemistry

Seven lines of code made station B crash for three hours, but "a scheming 0"

Zero basic learning canoe panel (12) -- progress bar
![[Video] Markov chain Monte Carlo method MCMC principle and R language implementation | data sharing](/img/20/bb43ab1bc447b519c3b1de0f809b31.png)
[Video] Markov chain Monte Carlo method MCMC principle and R language implementation | data sharing

Convolutional neural network model -- lenet network structure and code implementation
![[figure attack and Defense] backdoor attacks to graph neural networks (sacmat '21)](/img/d2/6be99fd194c66e4f60af38c6e52c93.png)
[figure attack and Defense] backdoor attacks to graph neural networks (sacmat '21)

MLIR原理与应用技术杂谈

Docekr学习 - MySQL8主从复制搭建部署

Esp32-c3 is based on blinker lighting control 10 way switch or relay group under Arduino framework

6W+字记录实验全过程 | 探索Alluxio经济化数据存储策略
随机推荐
Shell common script: check whether a domain name and IP address are connected
【视频】马尔可夫链原理可视化解释与R语言区制转换MRS实例|数据分享
【AI4Code】《IntelliCode Compose: Code Generation using Transformer》 ESEC/FSE 2020
Brpc source code analysis (III) -- the mechanism of requesting other servers and writing data to sockets
如何理解Keras中的指标Metrics
vim基础操作汇总
Handwriting a blog platform ~ first day
程序员奶爸自制AI喂奶检测仪,预判宝宝饿点,不让哭声影响老婆睡眠
Zero basic learning canoe panel (13) -- trackbar
Excel import and export source code analysis
Pytorch creates its own dataset and loads the dataset
备战2022 CSP-J1 2022 CSP-S1 初赛 视频集
Atcoder beginer contest 261 f / / tree array
Convolutional neural network model -- vgg-16 network structure and code implementation
【AI4Code】CodeX:《Evaluating Large Language Models Trained on Code》(OpenAI)
Esp32-c3 is based on blinker lighting control 10 way switch or relay group under Arduino framework
Convolutional neural network model -- googlenet network structure and code implementation
R语言GLM广义线性模型:逻辑回归、泊松回归拟合小鼠临床试验数据(剂量和反应)示例和自测题
TCP的拥塞控制
Zero basic learning canoe panel (15) -- CAPL output view