编译环境 os:linux22.04 ;python 3.8
mojoco_py可以安装成功,但是无法编译
报错:
distutils.errors.CompileError:https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxcheckurl?requrl=http%3A%2F%2Fdistutils.errors.CompileError%3A&skey=%40crypt_5903f840_de3b7047d0e5096882e4d19407c44b82&deviceid=e877405865326921&pass_ticket=undefined&opcode=2&scene=1&username=@48ce9ff3b9218205d9a424dd96c4b091718eba05d4195880c5f2ef41844cc6d0 command '/usr/bin/gcc' failed with exit code 1
测试代码:python3 -c 'import mujoco_py'
python3.8/site-packages/mujoco_py/gl/eglshim.c:4:10: fatal error: GL/glew.h: 没有那个文件或目录
原因:gcc 无法编译
解决方案:
sudo apt-get install libglew-dev libosmesa6-dev
conda install -c conda-forge gcc=12.1.0
参考:https://github.com/openai/mujoco-py#install-mujoco