MPI-IS / mesh

MPI-IS Mesh Processing Library
Other
643 stars 147 forks source link

NotImplementedError: Platform does not define a GLUT font retrieval function #66

Closed fyviezhao closed 2 years ago

fyviezhao commented 2 years ago
Traceback (most recent call last):
  File "run_tailornet.py", line 6, in <module>
    from psbody.mesh import Mesh
  File "/data/miniconda3/envs/pytorch/lib/python3.8/site-packages/psbody/mesh/__init__.py", line 10, in <module>
    from .meshviewer import MeshViewer, MeshViewers
  File "/data/miniconda3/envs/pytorch/lib/python3.8/site-packages/psbody/mesh/meshviewer.py", line 49, in <module>
    from OpenGL import GL, GLU, GLUT
  File "/data/miniconda3/envs/pytorch/lib/python3.8/site-packages/OpenGL/GLUT/__init__.py", line 5, in <module>
    from OpenGL.GLUT.fonts import *
  File "/data/miniconda3/envs/pytorch/lib/python3.8/site-packages/OpenGL/GLUT/fonts.py", line 20, in <module>
    p = platform.getGLUTFontPointer( name )
  File "/data/miniconda3/envs/pytorch/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py", line 344, in getGLUTFontPointer
    raise NotImplementedError(
NotImplementedError: Platform does not define a GLUT font retrieval function

I've tried export PYOPENGL_PLATFORM=osmesa, and also added -X when I ssh'ed into the linux machine https://github.com/MPI-IS/mesh/issues/49#issuecomment-705194582, but it didn't work. Can someone help me with this error?

fyviezhao commented 2 years ago

Sorry I didn't check my code carefully. I added another debug line os.environ['PYOPENGL_PLATFORM'] = 'egl' at the beginning of the python script, which wrongly overwrite the PYOPENGL_PLATFORM setting. The solution in https://github.com/MPI-IS/mesh/issues/49#issuecomment-705194582 is correct and for those who also meet this problem, you can solve it by:

$ sudo apt-get install libosmesa6
$ export PYOPENGL_PLATFORM=osmesa

Closed.