Skip to content

Unexcept .dylib load fail on macOs #7582

@zcf0508

Description

@zcf0508

Description of the issue

I built an executable file by pyinstaller and it works fine on Windows.
But when I run it on macOs, it has something wrong. This is the log.

Traceback (most recent call last):
  File "PyInstaller/loader/pyimod03_ctypes.py", line 53, in __init__
  File "ctypes/__init__.py", line 374, in __init__
OSError: dlopen(/Users/***/Downloads/autocut/autocut/torchaudio/lib/libtorchaudio.so, 0x0006): Library not loaded: @rpath/libtorch.dylib
  Referenced from: <F1ECED68-01D7-3188-9748-0F1860412214> /Users/***/Downloads/autocut/autocut/torchaudio/lib/libtorchaudio.so
  Reason: tried: '/System/Volumes/Preboot/Cryptexes/OS@rpath/libtorch.dylib' (no such file), '/usr/local/lib/libtorch.dylib' (no such file), '/usr/lib/libtorch.dylib' (no such file, not in dyld cache)

Actually, the file libtorch.dylib located in the folder /Users/***/Downloads/autocut/autocut.
It seems like that the parsing of @rpath is wrong. I searched for the related issues and tried to fix it.

  1. I add the path /Users/***/Downloads/autocut/autocut to $LD_LIBRARY_PATH
  2. Use installer_name_tool change @rpath,like installer_name_tool -change '@rpath/libtorch.dylib' '~/Downloads/autocut/autocut/libtorch.dylib' '~/Downloads/autocut/autocut/torchaudio/lib/libtorchaudio.so'

But it still doesn't work.

Context information (for bug reports)

  • Output of pyinstaller --version: 5.7.0

  • Version of Python: 3.9.16

  • Platform: macOs 13.2.1

  • How you installed Python: pyenv

  • Did you also try this on another platform? Does it work there?
    It works fine on Windows.

  • try the latest development version, using the following command:

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

Make sure everything is packaged correctly

  • start with clean installation
  • use the latest development version
  • Run your frozen program from a command window (shell) — instead of double-clicking on it
  • Package your program in --onedir mode
  • Package without UPX, say: use the option --noupx or set upx=False in your .spec-file
  • Repackage you application in verbose/debug mode. For this, pass the option --debug to pyi-makespec or pyinstaller or use EXE(..., debug=1, ...) in your .spec file.

A minimal example program which shows the error

autocut release
Downlowd the lastest release autocut_macos.zip and unzip.

cd ./autocut
chmod 777 ./autocut
./autocut -t ./whatever_video_file

Stacktrace / full error message

Packing log

426 INFO: PyInstaller: 5.10.1
426 INFO: Python: 3.9.16
450 INFO: Platform: macOS-13.2.1-x86_64-i386-64bit
455 INFO: UPX is not available.
459 INFO: Extending PYTHONPATH with paths
['/Users/***/Desktop/zcf0508/autocut']
1231 INFO: Appending 'datas' from .spec
1268 INFO: checking Analysis
1438 INFO: Building because /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py changed
1438 INFO: Initializing module dependency graph...
1442 INFO: Caching module graph hooks...
1454 INFO: Analyzing base_library.zip ...
2451 INFO: Loading module hook 'hook-encodings.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
3612 INFO: Loading module hook 'hook-pickle.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
4337 INFO: Loading module hook 'hook-heapq.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
5102 INFO: Caching module dependency graph...
5208 INFO: running Analysis Analysis-00.toc
5223 INFO: Analyzing /Users/***/Desktop/zcf0508/autocut/autocut.py
5267 INFO: Loading module hook 'hook-multiprocessing.util.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
5370 INFO: Loading module hook 'hook-xml.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
5888 INFO: Loading module hook 'hook-torch.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
6469 INFO: Loading module hook 'hook-platform.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
6541 INFO: Loading module hook 'hook-packaging.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
6629 INFO: Loading module hook 'hook-pkg_resources.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
7347 INFO: Loading module hook 'hook-sysconfig.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
7360 INFO: Processing pre-find module path hook distutils from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
7626 INFO: Loading module hook 'hook-distutils.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
7927 INFO: Loading module hook 'hook-numpy.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/numpy/_pyinstaller'...
8622 INFO: Loading module hook 'hook-difflib.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
13972 INFO: Loading module hook 'hook-sqlite3.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
16046 INFO: Loading module hook 'hook-PIL.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
16116 INFO: Loading module hook 'hook-PIL.Image.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
16716 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
19634 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
19887 INFO: Loading module hook 'hook-distutils.util.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
20467 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-urllib3.packages.six.moves.py'.
21384 INFO: Loading module hook 'hook-certifi.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
22038 INFO: Processing pre-safe import module hook tensorflow from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-tensorflow.py'.
24384 INFO: Processing pre-safe import module hook six.moves from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-six.moves.py'.
24522 INFO: Loading module hook 'hook-imageio.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
25491 INFO: Loading module hook 'hook-imageio_ffmpeg.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/moviepy/video/io/sliders.py:61: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if event.key is 'enter':
26768 INFO: Loading module hook 'hook-regex.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
29954 INFO: Loading module hook 'hook-setuptools.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
31784 INFO: Processing pre-safe import module hook win32com from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'.
43171 INFO: Processing module hooks...
44249 INFO: Loading module hook 'hook-platformdirs.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
44273 INFO: Loading module hook 'hook-_tkinter.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
44276 INFO: Not collecting Tcl/Tk data - either python is using macOS' system Tcl/Tk framework, or Tcl/Tk data directories could not be found.
44308 INFO: Loading module hook 'hook-setuptools.msvc.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
45487 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks'...
45737 INFO: Looking for ctypes DLLs
45746 WARNING: Library vcruntime140_1.dll required via ctypes not found
45748 WARNING: Library vcruntime140.dll required via ctypes not found
45749 WARNING: Library msvcp140.dll required via ctypes not found
45774 WARNING: Library libnvidia-ml.so.1 required via ctypes not found
45810 INFO: Analyzing run-time hooks ...
45831 INFO: Including run-time hook '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py'
45833 INFO: Including run-time hook '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_setuptools.py'
45834 INFO: Including run-time hook '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgres.py'
45839 INFO: Including run-time hook '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py'
45842 INFO: Including run-time hook '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth__tkinter.py'
45843 INFO: Including run-time hook '/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py'
46080 INFO: Looking for dynamic libraries
/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/building/build_main.py:177: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
  __import__(package)
/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/caffe2/__init__.py:5: UserWarning: Caffe2 support is not fully enabled in this PyTorch build. Please enable Caffe2 by building PyTorch from source with `BUILD_CAFFE2=1` flag.
  warnings.warn("Caffe2 support is not fully enabled in this PyTorch build. "
/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/caffe2/proto/__init__.py:17: UserWarning: Caffe2 support is not enabled in this PyTorch build. Please enable Caffe2 by building PyTorch from source with `BUILD_CAFFE2=1` flag.
  warnings.warn('Caffe2 support is not enabled in this PyTorch build. '
/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/caffe2/proto/__init__.py:17: UserWarning: Caffe2 support is not enabled in this PyTorch build. Please enable Caffe2 by building PyTorch from source with `BUILD_CAFFE2=1` flag.
  warnings.warn('Caffe2 support is not enabled in this PyTorch build. '
/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/caffe2/python/__init__.py:9: UserWarning: Caffe2 support is not enabled in this PyTorch build. Please enable Caffe2 by building PyTorch from source with `BUILD_CAFFE2=1` flag.
  warnings.warn('Caffe2 support is not enabled in this PyTorch build. '
/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/caffe2/proto/__init__.py:17: UserWarning: Caffe2 support is not enabled in this PyTorch build. Please enable Caffe2 by building PyTorch from source with `BUILD_CAFFE2=1` flag.
  warnings.warn('Caffe2 support is not enabled in this PyTorch build. '
/Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/caffe2/python/__init__.py:9: UserWarning: Caffe2 support is not enabled in this PyTorch build. Please enable Caffe2 by building PyTorch from source with `BUILD_CAFFE2=1` flag.
  warnings.warn('Caffe2 support is not enabled in this PyTorch build. '
4851 WARNING: Cannot find path ./libavcodec.58.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio_ffmpeg.so)
4851 WARNING: Cannot find path ./libtorch_python.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio_ffmpeg.so)
4851 WARNING: Cannot find path ./libtorchaudio_ffmpeg.so (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio_ffmpeg.so)
4851 WARNING: Cannot find path ./libavformat.58.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio_ffmpeg.so)
4852 WARNING: Cannot find path ./libtorch.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio_ffmpeg.so)
4852 WARNING: Cannot find path ./libavutil.56.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio_ffmpeg.so)
4852 WARNING: Cannot find path ./libavdevice.58.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio_ffmpeg.so)
4852 WARNING: Cannot find path ./libavfilter.7.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio_ffmpeg.so)
4852 WARNING: Cannot find path ./libtorch_cpu.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio_ffmpeg.so)
4852 WARNING: Cannot find path ./libc10.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio_ffmpeg.so)
4856 WARNING: Cannot find path ./libtorch_python.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio.so)
4856 WARNING: Cannot find path ./libtorchaudio.so (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio.so)
4856 WARNING: Cannot find path ./libtorch.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio.so)
4856 WARNING: Cannot find path ./libtorch_cpu.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio.so)
4856 WARNING: Cannot find path ./libc10.dylib (needed by /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/torchaudio/_torchaudio.so)
51871 INFO: Looking for eggs
51872 INFO: Using Python library /Users/***/.pyenv/versions/3.9.16/lib/libpython3.9.dylib
51925 INFO: Warnings written to /Users/***/Desktop/zcf0508/autocut/build/autocut/warn-autocut.txt
52156 INFO: Graph cross-reference written to /Users/***/Desktop/zcf0508/autocut/build/autocut/xref-autocut.html
52552 INFO: checking PYZ
52581 INFO: Building because toc changed
52581 INFO: Building PYZ (ZlibArchive) /Users/***/Desktop/zcf0508/autocut/build/autocut/PYZ-00.pyz
54909 INFO: Building PYZ (ZlibArchive) /Users/***/Desktop/zcf0508/autocut/build/autocut/PYZ-00.pyz completed successfully.
54976 INFO: EXE target arch: x86_64
54977 INFO: Code signing identity: None
54977 INFO: checking PKG
54978 INFO: Building because /Users/***/Desktop/zcf0508/autocut/build/autocut/PYZ-00.pyz changed
54978 INFO: Building PKG (CArchive) autocut.pkg
54996 INFO: Building PKG (CArchive) autocut.pkg completed successfully.
55002 INFO: Bootloader /Users/***/Desktop/zcf0508/autocut/.venv/lib/python3.9/site-packages/PyInstaller/bootloader/Darwin-64bit/run_d
55002 INFO: checking EXE
55003 INFO: Building because debug changed
55003 INFO: Building EXE from EXE-00.toc
55004 INFO: Copying bootloader EXE to /Users/***/Desktop/zcf0508/autocut/build/autocut/autocut
55005 INFO: Converting EXE to target arch (x86_64)
55029 INFO: Removing signature(s) from EXE
55055 INFO: Appending PKG archive to EXE
55065 INFO: Fixing EXE headers for code signing
55074 INFO: Re-signing the EXE
55172 INFO: Building EXE from EXE-00.toc completed successfully.
55191 INFO: checking COLLECT
WARNING: The output directory "/Users/***/Desktop/zcf0508/autocut/dist/autocut" and ALL ITS CONTENTS will be REMOVED! Continue? (y/N)y
On your own risk, you can use the option `--noconfirm` to get rid of this question.
108702 INFO: Removing dir /Users/***/Desktop/zcf0508/autocut/dist/autocut
111699 INFO: Building COLLECT COLLECT-00.toc
129320 INFO: Building COLLECT COLLECT-00.toc completed successfully.

Execution log

[57943] PyInstaller Bootloader 5.x
[57943] LOADER: executable is /Users/***/Desktop/zcf0508/autocut/dist/autocut/autocut
[57943] LOADER: homepath is /Users/***/Desktop/zcf0508/autocut/dist/autocut
[57943] LOADER: _MEIPASS2 is NULL
[57943] LOADER: archivename is /Users/***/Desktop/zcf0508/autocut/dist/autocut/autocut
[57943] LOADER: Cookie found at offset 0xEA4AD7
[57943] LOADER: No need to extract files to run; setting extractionpath to homepath
[57943] LOADER: Already in the child - running user's code.
[57943] LOADER: Python library: /Users/***/Desktop/zcf0508/autocut/dist/autocut/libpython3.9.dylib
[57943] LOADER: Loaded functions from Python library.
[57943] LOADER: Manipulating environment (sys.path, sys.prefix)
[57943] LOADER: sys.prefix is /Users/***/Desktop/zcf0508/autocut/dist/autocut
[57943] LOADER: Pre-init sys.path is /Users/***/Desktop/zcf0508/autocut/dist/autocut/base_library.zip:/Users/***/Desktop/zcf0508/autocut/dist/autocut/lib-dynload:/Users/***/Desktop/zcf0508/autocut/dist/autocut
[57943] LOADER: Setting runtime options
[57943] LOADER: Initializing python
[57943] LOADER: Overriding Python's sys.path
[57943] LOADER: Post-init sys.path is /Users/***/Desktop/zcf0508/autocut/dist/autocut/base_library.zip:/Users/***/Desktop/zcf0508/autocut/dist/autocut/lib-dynload:/Users/***/Desktop/zcf0508/autocut/dist/autocut
[57943] LOADER: Setting sys.argv
[57943] LOADER: setting sys._MEIPASS
[57943] LOADER: importing modules from CArchive
[57943] LOADER: extracted struct
[57943] LOADER: running unmarshalled code object for struct...
[57943] LOADER: extracted pyimod01_archive
[57943] LOADER: running unmarshalled code object for pyimod01_archive...
[57943] LOADER: extracted pyimod02_importers
[57943] LOADER: running unmarshalled code object for pyimod02_importers...
[57943] LOADER: extracted pyimod03_ctypes
[57943] LOADER: running unmarshalled code object for pyimod03_ctypes...
[57943] LOADER: Installing PYZ archive with Python modules.
[57943] LOADER: PYZ archive: PYZ-00.pyz
[57943] LOADER: Running pyiboot01_bootstrap.py
[57943] LOADER: Running pyi_rth_inspect.py
[57943] LOADER: Running pyi_rth_setuptools.py
[57943] LOADER: Running pyi_rth_pkgres.py
[57943] LOADER: Running pyi_rth_pkgutil.py
[57943] LOADER: Running pyi_rth__tkinter.py
[57943] LOADER: Running pyi_rth_multiprocessing.py
[57943] LOADER: Running autocut.py
None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
[autocut:transcribe.py:L38] INFO   Transcribing /Users/***/Downloads/VIDEO_20220715_152404.mp4
Traceback (most recent call last):
  File "PyInstaller/loader/pyimod03_ctypes.py", line 53, in __init__
  File "ctypes/__init__.py", line 374, in __init__
OSError: dlopen(/Users/***/Desktop/zcf0508/autocut/dist/autocut/torchaudio/lib/libtorchaudio.so, 0x0006): Library not loaded: @rpath/libtorch.dylib
  Referenced from: <F1ECED68-01D7-3188-9748-0F1860412214> /Users/***/Desktop/zcf0508/autocut/dist/autocut/torchaudio/lib/libtorchaudio.so
  Reason: tried: '/Users/***/.pyenv/versions/3.9.16/lib/libtorch.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/***/.pyenv/versions/3.9.16/lib/libtorch.dylib' (no such file), '/Users/***/.pyenv/versions/3.9.16/lib/libtorch.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/***/.pyenv/versions/3.9.16/lib/libtorch.dylib' (no such file), '/Users/***/.pyenv/versions/3.9.16/lib/libtorch.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/***/.pyenv/versions/3.9.16/lib/libtorch.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS@rpath/libtorch.dylib' (no such file), '/Users/***/.pyenv/versions/3.9.16/lib/libtorch.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/***/.pyenv/versions/3.9.16/lib/libtorch.dylib' (no such file), '/Users/***/.pyenv/versions/3.9.16/lib/libtorch.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/***/.pyenv/versions/3.9.16/lib/libtorch.dylib' (no such file), '/Users/***/.pyenv/versions/3.9.16/lib/libtorch.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/***/.pyenv/versions/3.9.16/lib/libtorch.dylib' (no such file), '/usr/local/lib/libtorch.dylib' (no such file), '/usr/lib/libtorch.dylib' (no such file, not in dyld cache)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "autocut.py", line 6, in <module>
  File "autocut/main.py", line 96, in main
  File "autocut/transcribe.py", line 49, in run
  File "autocut/transcribe.py", line 74, in _detect_voice_activity
  File "torch/hub.py", line 543, in load
    model = _load_local(repo_or_dir, model, *args, **kwargs)
  File "torch/hub.py", line 570, in _load_local
    hub_module = _import_module(MODULE_HUBCONF, hubconf_path)
  File "torch/hub.py", line 90, in _import_module
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/***/Desktop/zcf0508/autocut/dist/autocut/snakers4_silero-vad_master/hubconf.py", line 4, in <module>
    from utils_vad import (init_jit_model,
  File "/Users/***/Desktop/zcf0508/autocut/dist/autocut/snakers4_silero-vad_master/utils_vad.py", line 2, in <module>
    import torchaudio
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 352, in exec_module
  File "torchaudio/__init__.py", line 1, in <module>
    from torchaudio import (  # noqa: F401
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 352, in exec_module
  File "torchaudio/_extension.py", line 135, in <module>
    _init_extension()
  File "torchaudio/_extension.py", line 105, in _init_extension
    _load_lib("libtorchaudio")
  File "torchaudio/_extension.py", line 52, in _load_lib
    torch.ops.load_library(path)
  File "torch/_ops.py", line 573, in load_library
    ctypes.CDLL(path)
  File "PyInstaller/loader/pyimod03_ctypes.py", line 55, in __init__
pyimod03_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll '/Users/***/Desktop/zcf0508/autocut/dist/autocut/torchaudio/lib/libtorchaudio.so'. Most likely this dynlib/dll was not found when the application was frozen.
[57943] Failed to execute script 'autocut' due to unhandled exception!
[57943] LOADER: OK.
[57943] LOADER: Manually flushing stdout and stderr
[57943] LOADER: Cleaning up Python interpreter.

Please also see https://github.com/pyinstaller/pyinstaller/wiki/How-to-Report-Bugs
for more about what would use to solve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions