Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module 'pyglet.gl' has no attribute 'xlib' #113

Closed
CathyLou opened this issue May 10, 2020 · 4 comments
Closed

module 'pyglet.gl' has no attribute 'xlib' #113

CathyLou opened this issue May 10, 2020 · 4 comments

Comments

@CathyLou
Copy link

pyglet version is 1.4.10 and there is an error: module 'pyglet.gl' has no attribute 'xlib'
anyone can help me?

@kylinmb
Copy link

kylinmb commented May 14, 2020

I experienced the same issue with pyrender version 0.1.40, the pyglet version installed as a dependency is 1.5.5. I am running MacOS 10.15.4 (Catalina).

Steps to reproduce issue

  1. pip install pyrender
  2. In my code I called
r = pyrender.OffscreenRenderer(width, height)
color, depth = r.render(scene)

Exception:

Traceback (most recent call last):
  File "/Users/kylimckay-bishop/Workspace/image-embedding-data/renderSupershapes.py", line 297, in <module>
    main()
  File "/Users/kylimckay-bishop/Workspace/image-embedding-data/renderSupershapes.py", line 135, in main
    color, depth = r.render(scene)
  File "/Users/kylimckay-bishop/miniconda3/envs/dSpaceX/lib/python3.7/site-packages/pyrender/offscreen.py", line 109, in render
    self._platform.make_uncurrent()
  File "/Users/kylimckay-bishop/miniconda3/envs/dSpaceX/lib/python3.7/site-packages/pyrender/platforms/pyglet_platform.py", line 54, in make_uncurrent
    pyglet.gl.xlib.glx.glXMakeContextCurrent(self._window.context.x_display, 0, 0, None)
AttributeError: module 'pyglet.gl' has no attribute 'xlib'

Process finished with exit code 1

Workaround

Installing the previous version of pyrender resolved the issue for me:

pip install pyrender==0.1.39

@CathyLou
Copy link
Author

thx so much
add these two lines ⬇️ and it works

import os
os.environ["PYOPENGL_PLATFORM"] = "osmesa"

@cosw0t
Copy link
Contributor

cosw0t commented May 20, 2020

This is not a resolution. You have switched to software rendering with "osmesa". The problem with pyglet and OpenGL rendering on Windows and MacOS remains. It would be great to leave this issue open for the maintainer to see and fix it in the other use cases.

@cosw0t
Copy link
Contributor

cosw0t commented May 22, 2020

see #117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants