os.environ['PYOPENGL_PLATFORM'] = 'egl'
os.environ['EGL_PLATFORM'] = 'surfaceless'
then
egl_display = EGL.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY)
major, minor =egl.EGLint(), egl.EGLint()
result = EGL.eglInitialize(egl_display, pointer(major), pointer(minor))