Repository: pyinstaller/pyinstaller

Issue:
Pyinstaller can't find dynamically linked libs for Mac OS X Big Sur Beta 



## Context information (for bug reports)

* Output of `pyinstaller --version`: ```4.0.dev0```
* Version of Python: 3.8.5
* Platform: OS X 11.0 Beta Big Sur

[Link to Release Note below.](https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11-beta-release-notes/)
From apple: 

New in macOS Big Sur 11 beta, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)## Description of the issue

* Did you also try this on another platform? Does it work there?
Works on windows.  This is an issue with the new beta and a change that needs to be made for the new macOS Big Sur

### A minimal example program which shows the error

```
17946 ERROR: Can not find path /usr/lib/<lib> (needed by /usr/local/lib/<lib>.dylib)
...
many many more...
```

### Stacktrace / full error message

```
96 INFO: PyInstaller: 4.0.dev0
96 INFO: Python: 3.8.5
103 INFO: Platform: macOS-10.16-x86_64-i386-64bit
106 INFO: UPX is not available.
107 INFO: Removing temporary files and cleaning cache in /Users/nb/Library/Application Support/pyinstaller
123 INFO: Extending PYTHONPATH with paths
['/Users/nb/emerge/sw/tactile_engine/source/code',
 '/Users/nb/emerge/sw/tactile_engine/source/tactile_engine/source/code']
151 INFO: checking Analysis
151 INFO: Building Analysis because Analysis-00.toc is non existent
151 INFO: Initializing module dependency graph...
155 INFO: Caching module graph hooks...
164 INFO: Analyzing base_library.zip ...
2502 INFO: Processing pre-find module path hook distutils from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
2504 INFO: distutils: retargeting to non-venv dir '/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8'
4923 INFO: Caching module dependency graph...
5021 INFO: running Analysis Analysis-00.toc
5025 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/opt/python@3.8/bin/../Frameworks/Python.framework/Versions/3.8/bin/python3.8)
5028 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/Python)
5028 ERROR: Can not find path /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/Python)
5030 ERROR: Can not find path /usr/lib/libiconv.2.dylib (needed by /usr/local/lib/libintl.8.dylib)
5030 ERROR: Can not find path /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (needed by /usr/local/lib/libintl.8.dylib)
5030 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/libintl.8.dylib)
5030 INFO: Analyzing top/tactile_engine.py
7538 INFO: Processing pre-safe import module hook setuptools.extern.six.moves from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-setuptools.extern.six.moves.py'.
7971 INFO: Processing pre-find module path hook site from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks/pre_find_module_path/hook-site.py'.
7972 INFO: site: retargeting to fake-dir '/usr/local/lib/python3.8/site-packages/PyInstaller/fake-modules'
9360 INFO: Processing pre-safe import module hook six.moves from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-six.moves.py'.
/usr/local/lib/python3.8/site-packages/pyquaternion/quaternion.py:62: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if s is 0:
/usr/local/lib/python3.8/site-packages/pyquaternion/quaternion.py:104: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if len(elements) is 1:
/usr/local/lib/python3.8/site-packages/pyquaternion/quaternion.py:113: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif s is 1:
/usr/local/lib/python3.8/site-packages/pyquaternion/quaternion.py:152: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif len(seq) is 0:
11964 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-urllib3.packages.six.moves.py'.
13370 INFO: Processing module hooks...
13370 INFO: Loading module hook 'hook-usb.py' from '/usr/local/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
13395 INFO: Loading module hook 'hook-certifi.py' from '/usr/local/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
13400 INFO: Loading module hook 'hook-pytest.py' from '/usr/local/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
14521 INFO: Loading module hook 'hook-pkg_resources.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
14915 INFO: Processing pre-safe import module hook win32com from '/usr/local/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'.
15082 WARNING: Hidden import "pkg_resources.py2_warn" not found!
15308 WARNING: Hidden import "pkg_resources.markers" not found!
15310 INFO: Excluding import '__main__'
15311 INFO:   Removing import of __main__ from module pkg_resources
15311 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
15312 INFO: Loading module hook 'hook-lib2to3.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
15361 INFO: Loading module hook 'hook-encodings.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
15425 INFO: Loading module hook 'hook-setuptools.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
/usr/local/lib/python3.8/site-packages/setuptools/distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
  warnings.warn(
16004 INFO: Loading module hook 'hook-xml.dom.domreg.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
16005 INFO: Loading module hook 'hook-packaging.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
16006 INFO: Loading module hook 'hook-sysconfig.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
16013 INFO: Loading module hook 'hook-wcwidth.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
16020 INFO: Loading module hook 'hook-numpy.core.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
16120 INFO: Loading module hook 'hook-xml.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
16121 INFO: Loading module hook 'hook-numpy.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
16122 INFO: Loading module hook 'hook-distutils.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
16123 INFO: Loading module hook 'hook-pygments.py' from '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks'...
17773 INFO: Looking for ctypes DLLs
17826 WARNING: library ftd2xx64.dll required via ctypes not found
17863 WARNING: Ignoring /usr/local/lib/libftd2xx.dylib imported from /usr/local/lib/python3.8/site-packages/ftd2xx/_ftd2xx_darwin.py - ctypes imports are only supported using bare filenames
17906 INFO: Analyzing run-time hooks ...
17915 INFO: Including run-time hook '/usr/local/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_usb.py'
17919 INFO: Including run-time hook '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgres.py'
17920 INFO: Including run-time hook '/usr/local/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_certifi.py'
17921 INFO: Including run-time hook '/usr/local/lib/python3.8/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py'
17944 INFO: Looking for dynamic libraries
17946 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/libusb-1.0.dylib)
17947 ERROR: Can not find path /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (needed by /usr/local/lib/libusb-1.0.dylib)
17947 ERROR: Can not find path /usr/lib/libobjc.A.dylib (needed by /usr/local/lib/libusb-1.0.dylib)
17947 ERROR: Can not find path /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (needed by /usr/local/lib/libusb-1.0.dylib)
17949 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/libftd2xx.dylib)
17949 ERROR: Can not find path /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (needed by /usr/local/lib/libftd2xx.dylib)
17949 ERROR: Can not find path /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (needed by /usr/local/lib/libftd2xx.dylib)
17952 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/libftd2xx.dylib)
17952 ERROR: Can not find path /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (needed by /usr/local/lib/libftd2xx.dylib)
17952 ERROR: Can not find path /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (needed by /usr/local/lib/libftd2xx.dylib)
17953 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/select.cpython-38-darwin.so)
17954 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/math.cpython-38-darwin.so)
17955 ERROR: Can not find path /usr/lib/libz.1.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/zlib.cpython-38-darwin.so)
17955 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/zlib.cpython-38-darwin.so)
17957 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/pyexpat.cpython-38-darwin.so)
17958 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_scproxy.cpython-38-darwin.so)
17958 ERROR: Can not find path /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_scproxy.cpython-38-darwin.so)
17958 ERROR: Can not find path /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_scproxy.cpython-38-darwin.so)
17959 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/termios.cpython-38-darwin.so)
17960 ERROR: Can not find path /usr/lib/libz.1.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/binascii.cpython-38-darwin.so)
17960 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/binascii.cpython-38-darwin.so)
17961 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_random.cpython-38-darwin.so)
17963 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_sha512.cpython-38-darwin.so)
17965 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_ssl.cpython-38-darwin.so)
17966 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_hashlib.cpython-38-darwin.so)
17967 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_sha3.cpython-38-darwin.so)
17968 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_blake2.cpython-38-darwin.so)
17969 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_sha256.cpython-38-darwin.so)
17970 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_md5.cpython-38-darwin.so)
17971 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_sha1.cpython-38-darwin.so)
17972 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_bisect.cpython-38-darwin.so)
17974 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/unicodedata.cpython-38-darwin.so)
17976 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_contextvars.cpython-38-darwin.so)
17977 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_decimal.cpython-38-darwin.so)
17978 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_datetime.cpython-38-darwin.so)
17979 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_posixshmem.cpython-38-darwin.so)
17980 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/mmap.cpython-38-darwin.so)
17982 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_ctypes.cpython-38-darwin.so)
17983 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/array.cpython-38-darwin.so)
17984 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_queue.cpython-38-darwin.so)
17985 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/resource.cpython-38-darwin.so)
17986 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/grp.cpython-38-darwin.so)
17987 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_lzma.cpython-38-darwin.so)
17988 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_bz2.cpython-38-darwin.so)
17988 ERROR: Can not find path /usr/lib/libbz2.1.0.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_bz2.cpython-38-darwin.so)
17989 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_csv.cpython-38-darwin.so)
17990 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/readline.cpython-38-darwin.so)
17991 ERROR: Can not find path /usr/lib/libncurses.5.4.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/readline.cpython-38-darwin.so)
17992 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_opcode.cpython-38-darwin.so)
17993 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_pickle.cpython-38-darwin.so)
17994 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_multiprocessing.cpython-38-darwin.so)
17996 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_struct.cpython-38-darwin.so)
17997 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_testcapi.cpython-38-darwin.so)
18000 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_elementtree.cpython-38-darwin.so)
18001 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_asyncio.cpython-38-darwin.so)
18002 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_posixsubprocess.cpython-38-darwin.so)
18003 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_uuid.cpython-38-darwin.so)
18004 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_multibytecodec.cpython-38-darwin.so)
18005 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_codecs_kr.cpython-38-darwin.so)
18006 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_codecs_jp.cpython-38-darwin.so)
18007 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_codecs_tw.cpython-38-darwin.so)
18009 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_codecs_iso2022.cpython-38-darwin.so)
18010 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_codecs_cn.cpython-38-darwin.so)
18011 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_codecs_hk.cpython-38-darwin.so)
18012 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_heapq.cpython-38-darwin.so)
18013 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/_yaml.cpython-38-darwin.so)
18014 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/syslog.cpython-38-darwin.so)
18016 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_curses.cpython-38-darwin.so)
18016 ERROR: Can not find path /usr/lib/libncurses.5.4.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_curses.cpython-38-darwin.so)
18017 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/fcntl.cpython-38-darwin.so)
18045 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/parser.cpython-38-darwin.so)
18046 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/core/_multiarray_tests.cpython-38-darwin.so)
18050 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so)
18050 ERROR: Can not find path /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (needed by /usr/local/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so)
18053 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/random/mtrand.cpython-38-darwin.so)
18054 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/random/_sfc64.cpython-38-darwin.so)
18055 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/random/_philox.cpython-38-darwin.so)
18057 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/random/_pcg64.cpython-38-darwin.so)
18058 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/random/_mt19937.cpython-38-darwin.so)
18059 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/random/_bit_generator.cpython-38-darwin.so)
18061 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/random/_generator.cpython-38-darwin.so)
18062 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/random/_bounded_integers.cpython-38-darwin.so)
18063 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/random/_common.cpython-38-darwin.so)
18065 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/fft/_pocketfft_internal.cpython-38-darwin.so)
18067 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/linalg/_umath_linalg.cpython-38-darwin.so)
18067 ERROR: Can not find path /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (needed by /usr/local/lib/python3.8/site-packages/numpy/linalg/_umath_linalg.cpython-38-darwin.so)
18068 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/numpy/linalg/lapack_lite.cpython-38-darwin.so)
18068 ERROR: Can not find path /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (needed by /usr/local/lib/python3.8/site-packages/numpy/linalg/lapack_lite.cpython-38-darwin.so)
18069 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/yarl/_quoting_c.cpython-38-darwin.so)
18070 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/python3.8/site-packages/multidict/_multidict.cpython-38-darwin.so)
18071 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_socket.cpython-38-darwin.so)
18072 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_json.cpython-38-darwin.so)
18073 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib)
18075 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib)
18077 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/liblzma.5.dylib)
18078 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/opt/readline/lib/libreadline.8.dylib)
18078 ERROR: Can not find path /usr/lib/libncurses.5.4.dylib (needed by /usr/local/opt/readline/lib/libreadline.8.dylib)
18079 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/lib/libyaml-0.2.dylib)
18080 INFO: Looking for eggs
18080 INFO: Using Python library /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/Python
18089 INFO: Warnings written to /Users/nb/emerge/sw/tactile_engine/source/code/build/tactile_engine/warn-tactile_engine.txt
18183 INFO: Graph cross-reference written to /Users/nb/emerge/sw/tactile_engine/source/code/build/tactile_engine/xref-tactile_engine.html
18210 INFO: Appending 'datas' from .spec
18214 INFO: checking PYZ
18214 INFO: Building PYZ because PYZ-00.toc is non existent
18214 INFO: Building PYZ (ZlibArchive) /Users/nb/emerge/sw/tactile_engine/source/code/build/tactile_engine/PYZ-00.pyz
19419 INFO: Building PYZ (ZlibArchive) /Users/nb/emerge/sw/tactile_engine/source/code/build/tactile_engine/PYZ-00.pyz completed successfully.
19445 INFO: checking PKG
19445 INFO: Building PKG because PKG-00.toc is non existent
19445 INFO: Building PKG (CArchive) PKG-00.pkg
19447 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/opt/python@3.8/bin/python3.8)
19464 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
19465 INFO: Bootloader /usr/local/lib/python3.8/site-packages/PyInstaller/bootloader/Darwin-64bit/run
19465 INFO: checking EXE
19465 INFO: Building EXE because EXE-00.toc is non existent
19465 INFO: Building EXE from EXE-00.toc
19465 INFO: Appending archive to EXE /Users/nb/emerge/sw/tactile_engine/source/code/build/tactile_engine/TactileEngine
19473 INFO: Fixing EXE for code signing /Users/nb/emerge/sw/tactile_engine/source/code/build/tactile_engine/TactileEngine
19476 INFO: Building EXE from EXE-00.toc completed successfully.
19477 INFO: checking COLLECT
19477 INFO: Building COLLECT because COLLECT-00.toc is non existent
19477 INFO: Removing dir /Users/nb/emerge/sw/tactile_engine/source/code/dist/tactile_engine
19493 INFO: Building COLLECT COLLECT-00.toc
20707 INFO: Building COLLECT COLLECT-00.toc completed successfully.
20714 INFO: checking BUNDLE
20714 INFO: Building BUNDLE because BUNDLE-00.toc is non existent
20714 INFO: Removing dir /Users/nb/emerge/sw/tactile_engine/source/code/dist/TactileEngine.app
20734 INFO: Building BUNDLE BUNDLE-00.toc
21871 INFO: moving BUNDLE data files to Resource directory
```




Discussion:
> Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path

Can you clarify what you mean here. Are you saying `os.path.exists("/path/to/lib.dyllib")` will always return false? And what would happen if we searched `PATH` variables using `shutil.which()` or `ctypes.util.find_library()`. 

I also notice all those missing libraries in your build log are all (I think) system ones. Is this only applicable to macOS's system libraries or does your test program just not happen to use any others?
That is true all the files are system ones.  In the new beta, they moved them and made them hidden in the directory structure. 

```
Link to Release Note above.
From apple:

New in macOS Big Sur 11 beta, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)## Description of the issue
```


All we have to do is use the command dlopen() which will check the lib for it in the cache. 

Here is the os.path call: 
```
In [2]: os.path.exists("/usr/lib/libSystem.B.dylib")
Out[2]: False
```

Can you also check the other commands? Actively loading each dylib is not something we want to do unless we have no choice...

```python
ctypes.utils.find_library("libSystem.B.dylib")
shutil.which("libSystem.B.dylib")
```
And just to confirm that it does work:
```python
ctypes.CDLL("libSystem.B.dylib")._name
```
I can confirm that the first two return ``None`` but ``ctypes.CDLL("libSystem.B.dylib")._name`` does work.

https://github.com/python/cpython/pull/21241 addresses the issue with ``ctypes.util.find_library`` on macOS Big Sur.
Well as `ctypes` is standard lib the best we can hope for is for someone to write a backport if we want to support macOS Big Sur on current versions of Python. Looking at those [changes needed](https://github.com/python/cpython/pull/21241/files), I certainly wouldn't attempt to reproduce this into PyInstaller.

I'm still not clear on the impact of this. Is this specific to built-in system libraries? And if so, do we need to include them? On Windows it's generally a good idea to bring system libraries with you as they often turn out not to be standard - how stable is macOS's system libraries?
> the best we can hope for is for someone to write a backport

I think it is planned to fully support Big Sur in a future Python 3.8 bugfix release. This still leaves Python 3.7 and lower without the fixes.

> Is this specific to built-in system libraries? 

This is specific to system libraries only and has been the default in iOS for some time. In my experience, macOS libraries are sufficiently stable so that the don't need to be included. But my experience is limited...
I suppose the thing to do would be to run the test suite on a Big Sur. Would you be able to do this?
Done. The output looks pretty grim but many of the failures seem to be related to not finding the system's Tk library and therefore are directly caused by this issue. For reference, I am using Python 3.8 installed with homebrew.

Attached is a (large) file with the test output.

[pyinstaller_test_macOS_11.txt](https://github.com/pyinstaller/pyinstaller/files/5219988/pyinstaller_test_macOS_11.txt)

Great, thanks for that. Can I ask which version of PyInstaller you used? I'm guessing you cloned the development branch? But it looks like they're all failing in the same place. Namely that `_find_tcl_tk()` hook which we know to be broken but we have an unmerged fix for #5013. Mind if I @mention you once it's merged and you can run it again?
I tried both the dev branch and the fix from #5013 with similar results. Still, feel free to @mention me in the PR.

Actually attempting to load the libraries instead of using `macholib.dyld.dyld_find` or `os.path.exists` resolves many of the failures. The resulting test output looks much better, however some failures mostly regarding ctypes remain:

[pyinstaller_patched_test_macOS_11.txt](https://github.com/pyinstaller/pyinstaller/files/5221029/pyinstaller_patched_test_macOS_11.txt)

I know that this is something which you would rather avoid. Nevertheless, the patch goes as follows:

```diff
diff --git a/PyInstaller/depend/bindepend.py b/PyInstaller/depend/bindepend.py
index 95660b5dcef0f7167bf62007422233daefb758a7..854947b364b4242f2bea89ee6cbd9cd7c382879a 100644
--- a/PyInstaller/depend/bindepend.py
+++ b/PyInstaller/depend/bindepend.py
@@ -21,6 +21,7 @@ from glob import glob
 # Required for extracting eggs.
 import zipfile
 import collections
+from ctypes import cdll
 
 from .. import compat
 from ..compat import (is_win, is_win_10, is_unix,
@@ -692,10 +693,17 @@ def _getImports_macholib(pth):
                 if not os.path.isabs(run_path):
                     run_path = os.path.join(exec_path, run_path)
                 # Stop looking for lib when found in first location.
-                if os.path.exists(os.path.join(run_path, lib)):
-                    final_lib = os.path.abspath(os.path.join(run_path, lib))
+                
+                try:
+                    candidate = os.path.exists(os.path.join(run_path, lib))
+                    cdll.LoadLibrary(candidate)
+                except OSError:
+                    pass
+                else:
+                    final_lib = candidate
                     rslt.add(final_lib)
                     break
+
             # Log error if no existing file found.
             if not final_lib:
                 logger.error('Can not find path %s (needed by %s)', lib, pth)
@@ -707,11 +715,13 @@ def _getImports_macholib(pth):
             # It is also replaced by 'exec_path'.
             if lib.startswith('@loader_path'):
                 lib = lib.replace('@loader_path', '@executable_path')
+            
             try:
-                lib = dyld_find(lib, executable_path=exec_path)
-                rslt.add(lib)
-            except ValueError:
+                cdll.LoadLibrary(lib)
+            except OSError:
                 logger.error('Can not find path %s (needed by %s)', lib, pth)
+            else:
+                rslt.add(lib)
 
     return rslt
 
```

Ah, damn. There was a typo in the patch. It should be `candidate = os.path.join(run_path, lib)` instead of `candidate = os.path.exists(os.path.join(run_path, lib))`. This gets rid of a few strange TypeErrors.

The correct patch:

[bindepend_patch_macos_11.txt](https://github.com/pyinstaller/pyinstaller/files/5221395/bindepend_patch_macos_11.txt)

And the test results:

[pyinstaller_patched_test_2_macOS_11.txt](https://github.com/pyinstaller/pyinstaller/files/5221392/pyinstaller_patched_test_2_macOS_11.txt)

Already a bit better. I will leave you to figure our the remaining failures but I'm happy to run tests for future fixes if helpful.



Thanks @SamSchott, that's really helpful. That gives us a pretty good idea of what we need to do - although I don't feel any better about doing it. 
Actually one thing - surely 
```diff
+            else:
+                rslt.add(lib)
```
would only add the library's name rather than its path? In which case they would not end up in the final build. Although, provided macOS is stable, we shouldn't actually need them.
Fair point. Finding the actual path however will be more difficult. Personally, I am using the following workaround for system libraries:

```Python
def find_library(name):
    paths = [
        f'/System/Library/Frameworks/{name}.framework/{name}',
        f'/usr/lib/lib{name}.dylib',
        f'{name}.dylib',
    ]

    for path in paths:
        try:
            cdll.LoadLibrary(path)
            return path
        except OSError:
            pass

    return None
```

but it's probably better to wait for the official fix of `find_library`.
> I tried both the dev branch and the fix from #5013 with similar results. Still, feel free to @mention me in the PR.
> 
> Actually attempting to load the libraries instead of using `macholib.dyld.dyld_find` or `os.path.exists` resolves many of the failures. The resulting test output looks much better, however some failures mostly regarding ctypes remain:
> 
> [pyinstaller_patched_test_macOS_11.txt](https://github.com/pyinstaller/pyinstaller/files/5221029/pyinstaller_patched_test_macOS_11.txt)
> 
> I know that this is something which you would rather avoid. Nevertheless, the patch goes as follows:
> 
> ```diff
> diff --git a/PyInstaller/depend/bindepend.py b/PyInstaller/depend/bindepend.py
> index 95660b5dcef0f7167bf62007422233daefb758a7..854947b364b4242f2bea89ee6cbd9cd7c382879a 100644
> --- a/PyInstaller/depend/bindepend.py
> +++ b/PyInstaller/depend/bindepend.py
> @@ -21,6 +21,7 @@ from glob import glob
>  # Required for extracting eggs.
>  import zipfile
>  import collections
> +from ctypes import cdll
>  
>  from .. import compat
>  from ..compat import (is_win, is_win_10, is_unix,
> @@ -692,10 +693,17 @@ def _getImports_macholib(pth):
>                  if not os.path.isabs(run_path):
>                      run_path = os.path.join(exec_path, run_path)
>                  # Stop looking for lib when found in first location.
> -                if os.path.exists(os.path.join(run_path, lib)):
> -                    final_lib = os.path.abspath(os.path.join(run_path, lib))
> +                
> +                try:
> +                    candidate = os.path.exists(os.path.join(run_path, lib))
> +                    cdll.LoadLibrary(candidate)
> +                except OSError:
> +                    pass
> +                else:
> +                    final_lib = candidate
>                      rslt.add(final_lib)
>                      break
> +
>              # Log error if no existing file found.
>              if not final_lib:
>                  logger.error('Can not find path %s (needed by %s)', lib, pth)
> @@ -707,11 +715,13 @@ def _getImports_macholib(pth):
>              # It is also replaced by 'exec_path'.
>              if lib.startswith('@loader_path'):
>                  lib = lib.replace('@loader_path', '@executable_path')
> +            
>              try:
> -                lib = dyld_find(lib, executable_path=exec_path)
> -                rslt.add(lib)
> -            except ValueError:
> +                cdll.LoadLibrary(lib)
> +            except OSError:
>                  logger.error('Can not find path %s (needed by %s)', lib, pth)
> +            else:
> +                rslt.add(lib)
>  
>      return rslt
>  
> ```

This patch works for me, thanks a lot for an early workaround 👍 
I have the same issue. I'm using Mac OS Big Sur and python 3.9 with 4.1 version of pyinstaller.
And when I start my app I have a following problem:

[4065] Error loading Python lib '/var/folders/ds/p4w3_2vd1mz4fxg7wrcbjsdr0000gn/T/_MEIAejivL/Python': dlopen: dlopen(/var/folders/ds/p4w3_2vd1mz4fxg7wrcbjsdr0000gn/T/_MEIAejivL/Python, 10): no suitable image found.
Did find: /var/folders/ds/p4w3_2vd1mz4fxg7wrcbjsdr0000gn/T/_MEIMlGBFg/Python: code signature invalid for '/var/folders/ds/p4w3_2vd1mz4fxg7wrcbjsdr0000gn/T/_MEIMlGBFg/Python'

How this problem can be fixed? I have already tried to sign my app, and it's working only when I choose "-D". But I need to use "-F". I can't use pyinstaller 4.0 cause it doesn't support python 3.8 or 3.9, and Big Sur doesn't support python 3.7. What to do? I need my app to work...
@sergei2009op note that you probably would not want to build on Big Sur anyway if you want your users on older macs to be able to run the binary.

see
https://github.com/pyinstaller/pyinstaller/issues/1191
https://pyinstaller.readthedocs.io/en/stable/usage.html#making-mac-os-x-apps-forward-compatible

> The only way to be certain your app supports an older version of Mac OS X is to run PyInstaller in the oldest version of the OS you need to support.
> @sergei2009op note that you probably would not want to build on Big Sur anyway if you want your users on older macs to be able to run the binary.
> 
> see
> #1191
> https://pyinstaller.readthedocs.io/en/stable/usage.html#making-mac-os-x-apps-forward-compatible
> 
> > The only way to be certain your app supports an older version of Mac OS X is to run PyInstaller in the oldest version of the OS you need to support.

Thank you for your answer. But I need to run my app on Big Sur in "onefile" mode without such errors. Do you know how it could be fixed? 
@SamSchott patch helped fixed a majority of my lib errors thank you!

Only having a problem with libopenblas.0.dylib which I need for numpy

` ERROR: Can not find path @executable_path/../.dylibs/libopenblas.0.dylib`

is the specific error. Strangely enough libopenblas.0.dylib is in the pyinstaller "binchache" folder that was created. I tried temporarily directing the path in bindepend to directly lead to it but still getting the same errors.
any work in progress??meet the same problem
Here are details from Apple in the [macOS Big Sur Release Notes](https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes):

> New in macOS Big Sur 11.0.1, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)

(which I found from the [same issue for Haskell/GHC](https://gitlab.haskell.org/ghc/ghc/-/issues/18446))
I am having the same issue trying to create a simple app with PyInstaller, like other people I'd need this to run on Big Sur as I don't care about lack of retro compatibility with previous Mac versions...isn't there really a fix to this since August? 
> Here are details from Apple in the [macOS Big Sur Release Notes](https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes):
> 
> > New in macOS Big Sur 11.0.1, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)
> 
> (which I found from the [same issue for Haskell/GHC](https://gitlab.haskell.org/ghc/ghc/-/issues/18446))

@yairchu Have you found any easy fix to this issue?

It looks like Python 3.9.1 has been released now with the necessary fixes for `ctypes.util.find_libary` and support to build universal binaries for macOS 11. There even is a universal binary build of Python 3.9 available to download from https://www.python.org/downloads/release/python-391, built on Big Sur with a deployment target of OS X 10.9. I am sure a backport to Python 3.8 will follow soon.

Provided there are no other issues with building on macOS 11, it might be easier to point users to a newer Python release instead of making changes to PyInstaller.

Edit: And of course recommend that people packaging for Apple silicon use the provided universal binary from python.org and rebuild the bootloader. The latter might involve some amount of work and possibly patches to the bootloader itself...
@SamSchott I'm on Python 3.9.1 and Pyinstaller 4.1 but still getting erros like:
```
10253 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/opt/python@3.9/bin/../Frameworks/Python.framework/Versions/3.9/bin/python3.9)
10261 ERROR: Can not find path /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (needed by /usr/local/Cellar/python@3.9/3.9.1/Frameworks/Python.framework/Versions/3.9/Python)
10264 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.9/3.9.1/Frameworks/Python.framework/Versions/3.9/Python)
```

Is there anything else I might need to change?
Apologies, my comment was clearly premature. I haven't used PyInstaller for some time.

It appears there are still changes required, namely actually using `ctypes.util.find_libary` instead of `dyld_find` from `macholib`. But at least this avoids loading each dylib!
Well, for what is worth, these error messages:
> 10253 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/opt/python@3.9/bin/../Frameworks/Python.framework/Versions/3.9/bin/python3.9)
10261 ERROR: Can not find path /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (needed by /usr/local/Cellar/python@3.9/3.9.1/Frameworks/Python.framework/Versions/3.9/Python)
10264 ERROR: Can not find path /usr/lib/libSystem.B.dylib (needed by /usr/local/Cellar/python@3.9/3.9.1/Frameworks/Python.framework/Versions/3.9/Python)

are very likely completely harmless, because PyInstaller does not bundle shared libraries from macOS system frameworks (nor does failure to find the library affect the dependency resolution, because those shared libraries depend only on other system framework shared libraries).

One scenario where the inability to find the system shared library on Big Sur may lead to an error is if a PyInstaller hook contains logic for collecting additional resources that depends on the the library's path (i.e., the resource location is determined relatively to the shared library's path). We used to have this issue with homebrew python that still used system Tcl/Tk, where the Tcl modules could not be collected because the Tcl shared library file could not be found on Big Sur (#5040) - but this has since been fixed (#5217).

So while those error messages are annoying, their impact should be quite limited, and the issues described in follow-up comments are actually different issues conflated and erroneously attributed to this one.
> @yairchu Have you found any easy fix to this issue?

I did make a work-around for the same problem in Haskell - https://yairchu.github.io/posts/intercept-to-fix
(note that the problem was already solved in GHC repo but I wanted to use older GHC versions)

It should be possible with some tweaks to make the same work-around fit for this use case as well, the `my_stat` function should be changed to also fake the existence of the files in question here (`/usr/lib/libSystem.B.dylib` etc)

Resolving patch:
diff --git a/PyInstaller/depend/bindepend.py b/PyInstaller/depend/bindepend.py
--- 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
 


Test patch: