Addon Only Works on Mac if Blender Started from Terminal I am trying to get Bligify to work on a Mac computer. The addon uses subprocess to call Gifsicle and ImageMagick to create animated gifs from the VSE.

The addon works on Mac only if Blender is opened with the terminal. I'm not sure why this is, especially because the addon seems to work fine on Windows and Linux without the console open. How do I make Bligify work on Mac even if Blender is not opened with the terminal?
One approach is to add a preference panel to configure the PATH to each of the external programs.

A second approach is to add a preference allowing the use of a custom path and use that as an override when you call the program:

import os
import subprocess

PREFERENCE_PATH_OVERRIDE = '/usr/local/bin:/Users/myname/bin'

local_env = os.environ.copy()
if PREFERENCE_PATH_OVERRIDE:
    local_env['PATH'] = (
        PREFERENCE_PATH_OVERRIDE + os.pathsep + local_env['PATH'])

subprocess.call(
    ['magick', '--help'],
    stdout=subprocess.PIPE,
    stderr=subprocess.PIPE,
    env=local_env)


where PREFERENCE_PATH_OVERRIDE comes from the add-on's preferences.

I believe these two approaches are the best.



You could also use an add-on I just made that changes the PATH environment globally inside Blender: https://github.com/semond/system_path.



If you insist on forcing the user to modify the path at the OS level, it's a little complex on OS X. You can find a number of techniques on the web, some non-functional on the latest OS X.

On the latest OS X, the simplest method is probably to use this command:

sudo launchctl config user path &lt;path&gt;


You then have to reboot for it to take effect. The path will be set for all users on the system.

Another technique involves creating a bash script, and then register it to be executed when the user signs in.

Since I do not believe these are the most interesting approaches, I won't detail them. You could search for “how to set path for finder-launched applications” on Google.