I’ve created an addon which is causing an issue on one user’s machine. The problem is that the addon relys on a Python library that requires the ffmpeg binary to be on the user’s path. For some reason, Blender is not using the user’s path even though the user has set up their path to include the directory where they have ffmpeg installed. The addon only works for them if they manually add the directory to the path in Blender’s python console and then reimport the Whisper library.
The user’s computer is a Mac. Any idea why this would be happening?
No. Ffmpeg is not a python library but a regular binary app that should be available on the command line. While Whisper is a python module, it is making a command line call to try to run the ffmpeg program.
Oh… that’s strange… ffmpeg is in the standard location and can be called via the command line ? If not then maybe there is something wrong (typo) with the PATH var…
I’m no sure if apple does have/use any extra safty mechanism like for example not exporting the PATH variable after calling an app ?? So blender is called but can’ execute any further process ( yeah a really strange idea… but maybe… … you know… ) ??
Looking at his github issue, your user found this with ChatGPT:
`import os
os.environ['PATH'] += os.pathsep + '/usr/local/bin'
from whisper.audio import load_audio # Ensure this is after setting PATH
# Your existing code
While I generally wouldn’t trust ChatGPT to code anything, apparently adding this in the Blender console worked for him. I’d suggest having him try each of those imports in separate instances of the blend file to see if the problem is the path or the whisper audio, or both.
Either way, it seems that your addon is not importing something properly for his environment. Could be a mac issue and he’s just the first mac user to actually flag it or it could be he just has a weird setup, but revisiting your import code based on his results and seeing if you can make it more robust wouldn’t hurt.
That’s definiively weird if ffmpeg is installed on /usr/local/bin and this is also already in the PATH variable and after adding it “again”…
…but havin a furter look on github:
There is also /usr/local/Cellar/ffmpeg/7.0.1/binbefore/usr/local/bin. This also “should not b e the problem” when installing some special lib this way… but…