pyopengl icon indicating copy to clipboard operation
pyopengl copied to clipboard

Unable to import _errors

Open KeAWang opened this issue 6 years ago • 2 comments

I'm unable to run the following from OpenGL.raw.GL import _errors on Arch Linux on mesa-18.2.3-1. Every time I try, I get the following error trace:

  File "<stdin>", line 1, in <module>
  File "PYTHON_INSTALLATION/lib/python3.7/site-packages/OpenGL/raw/GL/_errors.py", line 4, in <module>
    _error_checker = _ErrorChecker( _p, _p.GL.glGetError )
  File "PYTHON_INSTALLATION/lib/python3.7/ctypes/__init__.py", line 369, in __getattr__
    func = self.__getitem__(name)
  File "PYTHON_INSTALLATION/lib/python3.7/ctypes/__init__.py", line 374, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libOSMesa.so.8: undefined symbol: glGetError

Caused by https://github.com/mcfletch/pyopengl/blob/beea4e5987aa5c0cb4c480961fbe5be5fae5a759/OpenGL/raw/GL/_errors.py#L4

I don't have any experience with OpenGL or Mesa, so I would really appreciate any help with resolving this issue.

KeAWang avatar Oct 31 '18 15:10 KeAWang

I met the same issue

Guptajakala avatar Nov 25 '19 22:11 Guptajakala

From the linked issue in dm_control it seems that what was happening here was a fallback path attempts to use OSMesa (when GLFW is not available) but doesn't actually work. A missing glGetError is a core system/library failure, i.e. OSMesa is just an API that tries to make an off-screen OpenGL Context, and in this case it seems not to have succeeded in loading an OpenGL library (likely because of a missing library somewhere).

PyOpenGL + OSMesa is known to work on Ubuntu 18.04 with the correct libraries installed, but without further details we're not likely to track down the failure here.

mcfletch avatar Dec 28 '19 19:12 mcfletch