La prochaine grosse mise à jour de macOS, Big Sur, change complètement la gestion des bibliothèques du système (plus d'infos).

Prenons ce code tout à fait légitime :

import ctypes.util

def load_library():
    """Load the CoreGraphics library."""
    coregraphics = ctypes.util.find_library("CoreGraphics")
    if not coregraphics:
        raise RuntimeError("No CoreGraphics library found.")

    return ctypes.cdll.LoadLibrary(coregraphics)

Ce code tente de charger la bibliothèque CoreGraphics. Et cela fonctionnera sur macOS jusqu'à ce que Big Sur sorte officiellement. Dès lors :

>>> load_library()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 4, in load_library
RuntimeError: No CoreGraphics library found.

Le contournement :

import ctypes.util
from platform import mac_ver

def load_library():
    """Load the CoreGraphics library."""
    version = float(".".join(mac_ver()[0].split(".")[:2]))
    if version < 10.16:
        coregraphics = ctypes.util.find_library("CoreGraphics")
    else:
        # macOS Big Sur and newer
        coregraphics = "/System/Library/Frameworks/CoreGraphics.framework/Versions/Current/CoreGraphics"

    return ctypes.cdll.LoadLibrary(coregraphics)

Et maintenant :

>>> load_library()
<CDLL '/System/Library/Frameworks/CoreGraphics.framework/Versions/Current/CoreGraphics', handle 7fa06d51a8e0 at 0x101f8b400>

Source : (Python MSS) Mac: support macOS Big Sur.