title: Unable to import opengl.gl in python on macos
body: <p>I am using OpenGL to render a scene in python. My code works perfectly fine on windows but, for some reason, I'm having issues when importing opengl.gl on MacOS.</p>
  <p>The issue arises when calling <code>from OpenGL.GL import ...</code> in both python scripts and the python console.</p>
  <p>More specifically here is the exact call in my script:</p>
  <pre><code>from OpenGL.GL import glGenBuffers, glBindBuffer, glBufferData, \
      glGenVertexArrays, glBindVertexArray, glEnableVertexAttribArray, glVertexAttribPointer, \
      glDrawArrays, glUseProgram, glEnable, glDisable, \
      GL_ARRAY_BUFFER, GL_STATIC_DRAW, GL_DEPTH_TEST, \
      GL_FLOAT, GL_FALSE, \
      GL_TRIANGLES, GL_LINES, GL_LINE_STRIP
  </code></pre>
  <p>This results in the following error:</p>
  <pre><code>       Traceback (most recent call last):
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/platform/darwin.py&quot;, line 35, in GL
      return ctypesloader.loadLibrary(
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/platform/ctypesloader.py&quot;, line 36, in loadLibrary
      return _loadLibraryWindows(dllType, name, mode)
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/platform/ctypesloader.py&quot;, line 89, in _loadLibraryWindows
      return dllType( name, mode )
    File &quot;/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ctypes/__init__.py&quot;, line 373, in __init__
      self._handle = _dlopen(self._name, mode)
  OSError: ('dlopen(OpenGL, 10): image not found', 'OpenGL', None)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;/Users/iyadboustany/Desktop/lensmaster/Lensmaster.py&quot;, line 18, in &lt;module&gt;
      from MainWindow import MainWindow
    File &quot;/Users/iyadboustany/Desktop/lensmaster/MainWindow.py&quot;, line 14, in &lt;module&gt;
      from Robot import Robot
    File &quot;/Users/iyadboustany/Desktop/lensmaster/Robot.py&quot;, line 8, in &lt;module&gt;
      from Graphics.Scene import DHNode
    File &quot;/Users/iyadboustany/Desktop/lensmaster/Graphics/Scene.py&quot;, line 13, in &lt;module&gt;
      from OpenGL.GL import glGenBuffers, glBindBuffer, glBufferData, \
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/GL/__init__.py&quot;, line 3, in &lt;module&gt;
      from OpenGL import error as _error
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/error.py&quot;, line 12, in &lt;module&gt;
      from OpenGL import platform, _configflags
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/platform/__init__.py&quot;, line 36, in &lt;module&gt;
      _load()
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/platform/__init__.py&quot;, line 33, in _load
      plugin.install(globals())
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py&quot;, line 97, in install
      namespace[ name ] = getattr(self,name,None)
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py&quot;, line 15, in __get__
      value = self.fget( obj )
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/platform/darwin.py&quot;, line 62, in GetCurrentContext
      return self.CGL.CGLGetCurrentContext 
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py&quot;, line 15, in __get__
      value = self.fget( obj )
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/platform/darwin.py&quot;, line 45, in CGL
      def CGL(self): return self.GL
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py&quot;, line 15, in __get__
      value = self.fget( obj )
    File &quot;/usr/local/lib/python3.8/site-packages/OpenGL/platform/darwin.py&quot;, line 41, in GL
      raise ImportError(&quot;Unable to load OpenGL library&quot;, *err.args)
  ImportError: ('Unable to load OpenGL library', 'dlopen(OpenGL, 10): image not found', 'OpenGL', None)
  </code></pre>
  <p><strong>Notes</strong>:</p>
  <ul>
  <li>Running glxgears works just fine.</li>
  <li>I'm running macOS Big Sur beta (20A5343i)</li>
  <li>I'm using python 3.8.5</li>
  <li>I installed opengl using pip: <code>pip3 install PyOpenGL PyOpenGL_accelerate</code></li>
  </ul>