0

I have an app for MacOS that is compiled with py2app. The app uses the pydub module and the latter uses ffmpeg family package.

The problem is that once I compile the app and move it to a different OS, the subprocess call from pydub fails to find any of the ffmpeg packages even though they are installed in /usr/local/bin.

If I launch the app from terminal ./Nameapp.app/Contents/MacOs/Nameapp then it runs no problem, but if I launch it with double click then pydub complains not finding the packages and the app hangs where ffmpeg/ffprobe should do the work.

I can see that pydub searches in the /usr/local/bin only if launched from terminal, otherwise no. If I add /usr/local/bin to PATH, pydub doesnt complain anymore that it doesnt find ffmpeg/ffprobe, but it still gives me an error for both ffmpeg and ffprobe: [Errno 2] No such file or directory:.

If I hardcode the path pydub.AudioSegment.converter = "/usr/local/bin/ffmpeg", the app gives me only ffprobe error [Errno 2] No such file or directory:'ffprobe': 'ffprobe'.

On some other posts i've seen pydub.AudioSegment.ffprobe = "/path/to/ffprobe" but it doesnt seem to work in my case?

So my two questions are:

How to hardcode the ffprobe path in pydub?
How to solve this without hardcoding path?

Virgil Sisoe
  • 195
  • 1
  • 12
  • I had a similar experience in the past and I was able to solve by calling the `subprocess` with `['/bin/bash', '-i', '-c', name]`. but I wouldn't want to do this here – Virgil Sisoe Sep 18 '19 at 21:04

1 Answers1

0

for some reason it works when changing the shell to zsh... switching back to bash no. not really happy with this solution but it's something

Virgil Sisoe
  • 195
  • 1
  • 12