Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyinstaller can't find dynamically linked libs for Mac OS X Big Sur Beta #5107

Closed
nbrummel opened this issue Aug 27, 2020 · 53 comments · Fixed by #5464
Closed

Pyinstaller can't find dynamically linked libs for Mac OS X Big Sur Beta #5107

nbrummel opened this issue Aug 27, 2020 · 53 comments · Fixed by #5464
Labels
bug @high platform:OS X pull-request wanted Please submit a pull-request for this, maintainers will not actively work on this.

Comments

@nbrummel
Copy link

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.
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
@bwoodsend
Copy link
Member

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?

@nbrummel
Copy link
Author

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

@bwoodsend
Copy link
Member

bwoodsend commented Sep 1, 2020

Can you also check the other commands? Actively loading each dylib is not something we want to do unless we have no choice...

ctypes.utils.find_library("libSystem.B.dylib")
shutil.which("libSystem.B.dylib")

And just to confirm that it does work:

ctypes.CDLL("libSystem.B.dylib")._name

@samschott
Copy link

I can confirm that the first two return None but ctypes.CDLL("libSystem.B.dylib")._name does work.

python/cpython#21241 addresses the issue with ctypes.util.find_library on macOS Big Sur.

@bwoodsend
Copy link
Member

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, 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?

@samschott
Copy link

samschott commented Sep 14, 2020

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...

@bwoodsend
Copy link
Member

I suppose the thing to do would be to run the test suite on a Big Sur. Would you be able to do this?

@samschott
Copy link

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

@bwoodsend
Copy link
Member

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?

@samschott
Copy link

samschott commented Sep 14, 2020

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

I know that this is something which you would rather avoid. Nevertheless, the patch goes as follows:

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
 

@samschott
Copy link

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

And the test results:

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.

@bwoodsend
Copy link
Member

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.

@bwoodsend
Copy link
Member

bwoodsend commented Sep 15, 2020

Actually one thing - surely

+            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.

@samschott
Copy link

Fair point. Finding the actual path however will be more difficult. Personally, I am using the following workaround for system libraries:

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.

@silbo
Copy link

silbo commented Nov 21, 2020

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

I know that this is something which you would rather avoid. Nevertheless, the patch goes as follows:

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 👍

@sopryshko
Copy link

sopryshko commented Nov 25, 2020

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...

@SomberNight
Copy link

@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.

@sopryshko
Copy link

@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?

@kentletor
Copy link

kentletor commented Dec 2, 2020

@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.

@QIYA0130
Copy link

QIYA0130 commented Dec 7, 2020

any work in progress??meet the same problem

@m3nu
Copy link

m3nu commented Jan 18, 2021

It's not a cosmetic error for Python versions <3.9.1. I also tried with 3.7.8 and the resulting app wouldn't start.

If the issue is with a Python library that PyInstaller users, we may need to wait for more minor Python updates.

@rokm
Copy link
Member

rokm commented Jan 18, 2021

I am not sure if I understood you correctly or if I am missing something.

Your issue very likely has nothing to do with system libraries not being visible on Big Sur. This issue is dealing with error messages during application build, not at runtime - see the original report.

@rokm
Copy link
Member

rokm commented Jan 18, 2021

It's not a cosmetic error for Python versions <3.9.1. I also tried with 3.7.8 and the resulting app wouldn't start.

What's the error message, then? Does it imply that the cause are hidden system libraries on Big Sur?

@papr
Copy link

papr commented Jan 18, 2021

This issue is dealing with error messages during application build, not at runtime

Oh, you are right. My issue appears during runtime, not during build. (Build is on macOS 10.14 Mojave which is why I do not get the error message which this issue is about.) Thank you for taking the time to elaborate on your initial response.

@cperezabo
Copy link

Why this issue is closed? This is still happening in Python 3.9.1 + PyInstaller 4.2

@papr
Copy link

papr commented Feb 3, 2021

@cperezabo This issue was closed because the fix for it was merged in #5464. It will be included in the next PyInstaller release.

@cperezabo
Copy link

Thanks @papr, I wasn't aware of that fix!

@cperezabo
Copy link

Well.. I've been looking at the changes in that PR and it just silent the message, so maybe I'm having another issue, because since updated to Big Sur, I've not been able to build my app again, it just freezes and I have to force quit it. If I run it in CLI I have no errors so I don't know exactly how to debug it, any idea?

@papr
Copy link

papr commented Feb 3, 2021

@cperezabo Well, I suggest having a look at the other macOS Big Sur related issues, #5315 and #5491. Also, if you open a new bug report, there is a list of steps to follow in this kind of situation. I suggest following it and if the issue persists to file the issue.

@JapinderSandhu
Copy link

JapinderSandhu commented Mar 10, 2021

@cperezabo This issue was closed because the fix for it was merged in #5464. It will be included in the next PyInstaller release.

when will this new release come out?

Running into this error on MacOS 10.15.7 Catalina
My Env:

INFO: PyInstaller: 4.2
INFO: Python: 3.9.2 (conda)
INFO: Platform: macOS-10.15.7-x86_64-i386-64bit

I am using anaconda version: conda 4.8.2

[50576] Error loading Python lib '/var/folders/6z/snnb75fd7h734dd51kbdjntw0000gn/T/_MEIspzQDS/libpython3.9.dylib': dlopen: dlopen(/var/folders/6z/snnb75fd7h734dd51kbdjntw0000gn/T/_MEIspzQDS/libpython3.9.dylib, 10): no suitable image found. Did find:
/var/folders/6z/snnb75fd7h734dd51kbdjntw0000gn/T/_MEIspzQDS/libpython3.9.dylib: code signature in (/var/folders/6z/snnb75fd7h734dd51kbdjntw0000gn/T/_MEIspzQDS/libpython3.9.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

Update:

I tried it with the developer version of pyinstaller
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

pyinstaller 5.0.dev0
pyinstaller-hooks-contrib 2021.1

It suppressed the errors when I package using --onefile

but I am still getting the same error when I run my executable

[40125] Error loading Python lib '/var/folders/0r/jz_vw8vn54b85gh437lwcgdw0000gn/T/_MEIjzyz9g/libpython3.9.dylib': dlopen: dlopen(/var/folders/0r/jz_vw8vn54b85gh437lwcgdw0000gn/T/_MEIjzyz9g/libpython3.9.dylib, 10): no suitable image found.  Did find:
	/var/folders/0r/jz_vw8vn54b85gh437lwcgdw0000gn/T/_MEIjzyz9g/libpython3.9.dylib: code signature in (/var/folders/0r/jz_vw8vn54b85gh437lwcgdw0000gn/T/_MEIjzyz9g/libpython3.9.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

@PyMarc2
Copy link

PyMarc2 commented Mar 18, 2021

+1

@imperialguy
Copy link

This issue is clearly still not fixed. Same errors.

@Legorooj
Copy link
Member

Legorooj commented Apr 5, 2021

This issue is clearly still not fixed. Same errors.

@imperialguy have you tried running the development version? You might need to rebuild the bootloaders too.

@jdson7
Copy link

jdson7 commented Apr 5, 2021

Same errors here, using developer version too

@cperezabo This issue was closed because the fix for it was merged in #5464. It will be included in the next PyInstaller release.

when will this new release come out?

Running into this error on MacOS 10.15.7 Catalina
My Env:

INFO: PyInstaller: 4.2
INFO: Python: 3.9.2 (conda)
INFO: Platform: macOS-10.15.7-x86_64-i386-64bit

I am using anaconda version: conda 4.8.2

[50576] Error loading Python lib '/var/folders/6z/snnb75fd7h734dd51kbdjntw0000gn/T/_MEIspzQDS/libpython3.9.dylib': dlopen: dlopen(/var/folders/6z/snnb75fd7h734dd51kbdjntw0000gn/T/_MEIspzQDS/libpython3.9.dylib, 10): no suitable image found. Did find:
/var/folders/6z/snnb75fd7h734dd51kbdjntw0000gn/T/_MEIspzQDS/libpython3.9.dylib: code signature in (/var/folders/6z/snnb75fd7h734dd51kbdjntw0000gn/T/_MEIspzQDS/libpython3.9.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

Update:

I tried it with the developer version of pyinstaller
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

pyinstaller 5.0.dev0
pyinstaller-hooks-contrib 2021.1

It suppressed the errors when I package using --onefile

but I am still getting the same error when I run my executable

[40125] Error loading Python lib '/var/folders/0r/jz_vw8vn54b85gh437lwcgdw0000gn/T/_MEIjzyz9g/libpython3.9.dylib': dlopen: dlopen(/var/folders/0r/jz_vw8vn54b85gh437lwcgdw0000gn/T/_MEIjzyz9g/libpython3.9.dylib, 10): no suitable image found.  Did find:
	/var/folders/0r/jz_vw8vn54b85gh437lwcgdw0000gn/T/_MEIjzyz9g/libpython3.9.dylib: code signature in (/var/folders/0r/jz_vw8vn54b85gh437lwcgdw0000gn/T/_MEIjzyz9g/libpython3.9.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

@bwoodsend
Copy link
Member

Have you recompiled the bootloaders?

@rokm
Copy link
Member

rokm commented Apr 5, 2021

Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

Looks like x86_64 is now starting to require at least ad-hoc code signing, same as M1. This is a different issue than hidden system libraries (which is what this issue was about), and will be fixed once we implement ad-hoc re-signing as part of M1 support.

@rokm
Copy link
Member

rokm commented Apr 5, 2021

The problem with missing signature on libpython might be already fixed by WIP macos11-arm64-support-cleanup branch in #5581 (but there may or may not be additional issues with invalidated signatures on other collected shared libraries, depending on how strict x86_64 actually is).

@jdson7
Copy link

jdson7 commented Apr 5, 2021

Have you recompiled the bootloaders?

Yes, I have.

The exact error message when I run executable is this:
[1537] Error loading Python lib '/Users/myuser/Workspace/myproject/Darwin/x86_64/build/projectname/Python': dlopen: dlopen(/Users/myuser/Workspace/myproject/Darwin/x86_64/build/projectname/Python, 10): image not found

@rokm
Copy link
Member

rokm commented Apr 5, 2021

[1537] Error loading Python lib '/Users/myuser/Workspace/myproject/Darwin/x86_64/build/projectname/Python': dlopen: dlopen(/Users/myuser/Workspace/myproject/Darwin/x86_64/build/projectname/Python, 10): image not found

Ah, you're just trying to run the partial bundle from build directory instead of complete one in the dist directory...

@jdson7
Copy link

jdson7 commented Apr 5, 2021

[1537] Error loading Python lib '/Users/myuser/Workspace/myproject/Darwin/x86_64/build/projectname/Python': dlopen: dlopen(/Users/myuser/Workspace/myproject/Darwin/x86_64/build/projectname/Python, 10): image not found

Ah, you're just trying to run the partial bundle from build directory instead of complete one in the dist directory...

My mistake, sorry guys and thank you for your support!!

@gaumarjos
Copy link

gaumarjos commented Apr 7, 2021

I'm trying to build a very basic app that uses PyQt5 on Big Sur and I have the same problem with libraries.
Here's my configuration:

37 INFO: PyInstaller: 5.0.dev0
37 INFO: Python: 3.9.4
46 INFO: Platform: macOS-11.2.3-x86_64-i386-64bit

I compiled the bootloader as indicated here: https://github.com/pyinstaller/pyinstaller.
All I get is a waterfall of errors, most of the of the "cannot find path ..." type. I.e. 13859 ERROR: Can not find path /usr/lib/libSystem.B.dylib.

I don't think it's the app I'm building. It runs correctly if I launch it from terminal. I get errors even with the basic:

app = QApplication(sys.argv)
win = QMainWindow()
win.setGeometry(200, 200, 400, 200)
win.setFixedSize(400, 200)
win.setWindowTitle("blabla")
win.show()
sys.exit(app.exec_())

The exec and the app are created. The exec opens the terminal, writes segmentation fault and closes. The app crashes immediately after I open it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug @high platform:OS X pull-request wanted Please submit a pull-request for this, maintainers will not actively work on this.
Projects
None yet
Development

Successfully merging a pull request may close this issue.