From 3ef319ddceaad1d54fd68ce9a4ce1381ef6795dd Mon Sep 17 00:00:00 2001 From: Viktoria Shchypalkina <37249354+helavika@users.noreply.github.com> Date: Fri, 30 Oct 2026 21:06:33 +0200 Subject: [PATCH] gh-88130: Document that ctypes on macOS may not search /usr/local/lib Co-Authored-By: Claude Opus 5.5 --- Doc/library/ctypes.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index e4021e982825e81..f1c601c66af9a2e 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1582,6 +1582,14 @@ way is to instantiate :py:class:`CDLL` or one of its subclasses: If *name* does not contain a path separator, the library is found in a platform-specific way. + On macOS, depending on how Python was built, the dynamic loader may not + search directories such as :file:`/usr/local/lib` or + :file:`/Library/Frameworks`, so a library installed there is only found + by its full path. + Alternatively, set the :envvar:`!DYLD_LIBRARY_PATH` or + :envvar:`!DYLD_FRAMEWORK_PATH` environment variable before starting Python. + See the :manpage:`dlopen(3)` and :manpage:`dyld(1)` man pages for details. + On Windows, the ``.DLL`` suffix may be missing. (For details, see `LoadLibraryExW`_ documentation.) Other platform-specific prefixes and suffixes (for example, ``lib``,