1 问题描述
在 pip install pyrender
成功安装后,调用pyrender
库时报错:
OSError: (‘GL: cannot open shared object file: No such file or directory’, ‘GL’, None)
ImportError: (‘Unable to load OpenGL library’, ‘GL: cannot open shared object file: No such file or directory’, ‘GL’, None)
报错截图:
2 原因分析
这种问题一般会出现在本机/docker环境中,我这个错误发生在(基本上发生在linux系统中,windows一般都不会出现):
Ubuntu18.04
Python3.9
anaconda base
报错信息聚焦在:No such file or directory', 'GL'
。也就是当前环境中缺少GL库文件,是GL库有问题,所以导致pyrender
不能正常运行,这也解释了为什么pip install pyrender
可以正常安装,但是pyrender
却运行不了。
3 解决方法
既然是GL库文件缺失导致的这个问题,那就需要在当前系统中重新安装GL库文件。具体操作流