pyrender错误修复

pyrender 错误

  File "/usr/local/lib/python2.7/dist-packages/pyrender/viewer.py", line 347, in __init__
    self._init_and_start_app()
  File "/usr/local/lib/python2.7/dist-packages/pyrender/viewer.py", line 995, in _init_and_start_app
    height=self._viewport_size[1])
  File "/usr/local/lib/python2.7/dist-packages/pyglet/window/xlib/__init__.py", line 170, in __init__
    super(XlibWindow, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pyglet/window/__init__.py", line 595, in __init__
    context = config.create_context(gl.current_context)
  File "/usr/local/lib/python2.7/dist-packages/pyglet/gl/xlib.py", line 216, in create_context
    return XlibContextARB(self, share)
  File "/usr/local/lib/python2.7/dist-packages/pyglet/gl/xlib.py", line 322, in __init__
    super(XlibContext13, self).__init__(config, share)
  File "/usr/local/lib/python2.7/dist-packages/pyglet/gl/xlib.py", line 230, in __init__
    raise gl.ContextException('Could not create GL context')
pyglet.gl.ContextException: Could not create GL context

解决方法:

Hi I had a similar issue and fixed it by looking at which OpenGL version I had by calling:

glxinfo | grep OpenGL
>> OpenGL core profile version string: 3.3 (Core Profile) Mesa 19.1.3
Then I changed in the constants.py file in pyrender.py (you can find it wherever you installed pyrender in my case: ~/.local/lib/python3.7/site-packages/pyrender/constants.py)

OPEN_GL_MAJOR = 3
OPEN_GL_MINOR = 3
After that I was able to render :)!

参考链接:
https://github.com/mmatl/pyrender/issues/13#issuecomment-515080934

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值