PyPI packages that depend on Homebrew are always painful. otool -L (roughly equivalent to Linux’s ldd) is your go-to tool for this. The original unfrozen copy of pyaudio‘s extension module will be linked against libportaudio.*.dylib from Homebrew using an absolute path:
$ otool -L ./env/lib/python3.10/site-packages/pyaudio/_portaudio.cpython-310-darwin.so ./env/lib/python3.10/site-packages/pyaudio/_portaudio.cpython-310-darwin.so: /opt/homebrew/opt/portaudio/lib/libportaudio.2.dylib (compatibility version 3.0.0, current version 3.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)Now PyInstaller is supposed to to replace that path with an @rpath (relative to the parent executable) entry so that your application is relocatable. That has worked fine for me:
$ otool -L ./dist/test/pyaudio/_portaudio.cpython-310-darwin.so ./dist/test/pyaudio/_portaudio.cpython-310-darwin.so: @rpath/libportaudio.2.dylib (compatibility version 3.0.0, current version 3.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)Are you sure you’re not just running some out of date PyInstaller that predates linker path rewriting?