当前位置:网站首页>安装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
边栏推荐
- [300 opencv routines] 239. accurate positioning of Harris corner detection (cornersubpix)
- Concurrent programming - memory model JMM
- 备战2022 CSP-J1 2022 CSP-S1 初赛 视频集
- Substance Designer 2021软件安装包下载及安装教程
- Migrate PaloAlto ha high availability firewall to panorama
- Atcoder beginer contest 261e / / bitwise thinking + DP
- Zero basic learning canoe panel (15) -- CAPL output view
- Emqx cloud update: more parameters are added to log analysis, which makes monitoring, operation and maintenance easier
- Error: cannot find or load main class XXXX
- 卷积神经网络模型之——GoogLeNet网络结构与代码实现
猜你喜欢

【GCN-CTR】DC-GNN: Decoupled GNN for Improving and Accelerating Large-Scale E-commerce Retrieval WWW22

Word style and multi-level list setting skills (II)

Chapter5 : Deep Learning and Computational Chemistry

cv2.resize函数报错:error: (-215:Assertion failed) func != 0 in function ‘cv::hal::resize‘

The programmer's father made his own AI breast feeding detector to predict that the baby is hungry and not let the crying affect his wife's sleep

VIM tip: always show line numbers

yum和vim须掌握的常用操作

Business visualization - make your flowchart'run'(3. Branch selection & cross language distributed operation node)

Cv2.resize function reports an error: error: (-215:assertion failed) func= 0 in function ‘cv::hal::resize‘

如何用因果推断和实验驱动用户增长? | 7月28日TF67
随机推荐
int数组获取重复数据
Shell常用脚本:判断远程主机的文件是否存在
Design and principle of thread pool
massCode 一款优秀的开源代码片段管理器
【AI4Code】《Pythia: AI-assisted Code Completion System》(KDD 2019)
二叉树基本知识
Django 2 ----- 数据库与Admin
Machine learning strong foundation program 0-4: popular understanding of Occam razor and no free lunch theorem
Simple understanding of flow
Common operations for Yum and VIM
The world is exploding, and the Google server has collapsed
0715RHCSA
OAuth,JWT ,OIDC你们搞得我好乱啊
IM系统-消息流化一些常见问题
Date and time function of MySQL function summary
Handwriting a blog platform ~ first day
Blindly expanding the scale of the meta universe has deviated from the development logic of the meta universe
业务可视化-让你的流程图'Run'起来(3.分支选择&跨语言分布式运行节点)
网络空间安全 渗透攻防9(PKI)
Word style and multi-level list setting skills (II)