diff --git a/PyInstaller/depend/bindepend.py b/PyInstaller/depend/bindepend.py index f2e63e265a..153278e760 100644 --- a/PyInstaller/depend/bindepend.py +++ b/PyInstaller/depend/bindepend.py @@ -616,6 +616,7 @@ def _getImports_macholib(pth): from macholib.MachO import MachO from macholib.mach_o import LC_RPATH from macholib.dyld import dyld_find + from macholib.util import in_system_path rslt = set() seen = set() # Libraries read from binary headers. @@ -711,7 +712,12 @@ def _getImports_macholib(pth): lib = dyld_find(lib, executable_path=exec_path) rslt.add(lib) except ValueError: - logger.error('Can not find path %s (needed by %s)', lib, pth) + # Starting with Big Sur, system libraries are hidden. And + # we do not collect system libraries on any macOS version + # anyway, so suppress the corresponding error messages. + if not in_system_path(lib): + logger.error('Can not find path %s (needed by %s)', + lib, pth) return rslt diff --git a/news/5107.bugfix.rst b/news/5107.bugfix.rst new file mode 100644 index 0000000000..f3d087c851 --- /dev/null +++ b/news/5107.bugfix.rst @@ -0,0 +1,3 @@ +(OSX) Suppress missing library error messages for system libraries as +those are never collected by PyInstaller and starting with Big Sur, +they are hidden by the OS.