mmatl / pyrender

Easy-to-use glTF 2.0-compliant OpenGL renderer for visualization of 3D scenes.
http://pyrender.readthedocs.io/
MIT License
1.3k stars 225 forks source link

pyglet error #32

Open JonathanLehner opened 5 years ago

JonathanLehner commented 5 years ago

I tried to run pyrender on the Leonard cluster at ETH Zurich. https://scicomp.ethz.ch/wiki/Leonhard_applications_and_libraries

I get the following error:

File "/cluster/home/lehnerj/.local/share/virtualenvs/wearable3dhandreconstruction--fu_gjdO/lib/python3.6/site-packages/pyglet/init.py", line 351, in getattr return getattr(self._module, name) AttributeError: 'NoneType' object has no attribute 'Window'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/cluster/home/lehnerj/.local/share/virtualenvs/wearable3dhandreconstruction--fu_gjdO/lib/python3.6/site-packages/pyglet/init.py", line 351, in getattr return getattr(self._module, name) AttributeError: 'NoneType' object has no attribute '_create_shadow_window'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "full_pipeline.py", line 354, in import pyrender File "/cluster/home/lehnerj/.local/share/virtualenvs/wearable3dhandreconstruction--fu_gjdO/lib/python3.6/site-packages/pyrender/init.py", line 12, in from .viewer import Viewer File "/cluster/home/lehnerj/.local/share/virtualenvs/wearable3dhandreconstruction--fu_gjdO/lib/python3.6/site-packages/pyrender/viewer.py", line 36, in class Viewer(pyglet.window.Window): File "/cluster/home/lehnerj/.local/share/virtualenvs/wearable3dhandreconstruction--fu_gjdO/lib/python3.6/site-packages/pyglet/init.py", line 357, in getattr import(import_name) File "/cluster/home/lehnerj/.local/share/virtualenvs/wearable3dhandreconstruction--fu_gjdO/lib/python3.6/site-packages/pyglet/window/init.py", line 1872, in gl._create_shadow_window() File "/cluster/home/lehnerj/.local/share/virtualenvs/wearable3dhandreconstruction--fu_gjdO/lib/python3.6/site-packages/pyglet/init.py", line 357, in getattr import(import_name) File "/cluster/home/lehnerj/.local/share/virtualenvs/wearable3dhandreconstruction--fu_gjdO/lib/python3.6/site-packages/pyglet/gl/init.py", line 100, in from pyglet.gl.lib import GLException File "/cluster/home/lehnerj/.local/share/virtualenvs/wearable3dhandreconstruction--fu_gjdO/lib/python3.6/site-packages/pyglet/gl/lib.py", line 143, in from pyglet.gl.lib_glx import link_GL, link_GLU, link_GLX File "/cluster/home/lehnerj/.local/share/virtualenvs/wearable3dhandreconstruction--fu_gjdO/lib/python3.6/site-packages/pyglet/gl/lib_glx.py", line 51, in glu_lib = pyglet.lib.load_library('GLU') File "/cluster/home/lehnerj/.local/share/virtualenvs/wearable3dhandreconstruction--fu_gjdO/lib/python3.6/site-packages/pyglet/lib.py", line 168, in load_library raise ImportError('Library "%s" not found.' % names[0]) ImportError: Library "GLU" not found.

JonathanLehner commented 5 years ago

will try loading mesa-glu/9.0.0

mmatl commented 5 years ago

Try sudo apt install freeglut3-dev.

dcetin commented 4 years ago

Hey @JonathanLehner,

How did you resolve this issue on Leonhard? I work on another project, yet I couldn't find how to run the code that uses OpenGL on server. I loaded ftgl/2.1.3 module (which also includes mesa/12.0.3 and mesa-glu/9.0.0), but it didn't help.

Trying to run the script normally gives this error

ValueError: Failed to initialize Pyglet window with an OpenGL >= 3+ context. If you're logged in via SSH, ensure that you're running your script with vglrun (i.e. VirtualGL). The internal error message was "Cannot connect to "None""

and prepending PYOPENGL_PLATFORM=osmesa to the python command gives

ImportError: ('Unable to load OpenGL library', 'OSMesa: cannot open shared object file: No such file or directory', 'OSMesa', None)

I would be really happy to hear your comment. Cheers.

dipaco commented 4 years ago

I am experiencing the same issue as @dcetin described above.

mvasil commented 3 years ago

Fix for me: sudo apt-get install libosmesa6-dev

thezealousfool commented 3 years ago

On Arch linux I installed python-opengl and freeglut but was still getting this error. Installing the package glu fixed the problem for me -

sudo pacman -S freeglut python-opengl glu