SYMPTOMS

You have set up your path substitutions under Edit > Preferences... in Nuke, but the file paths aren’t substituted correctly during command line rendering or Python Terminal mode. Your path substitutions would look like:

CAUSE

File paths may not be substituted correctly on a command line render or Python Terminal mode because Preferences aren't loaded when Nuke is run outside of GUI mode.

Terminal mode (without GUI) allows you to enter Python commands without launching the GUI. A >>> command prompt is displayed during this mode. Command line mode (batch mode) allows you to run commands in the terminal to render your Nuke script (without GUI). Please see the Nuke Online Help on Command Line Operations for more information.

RESOLUTION

To solve this, you can use the command line argument --remap, which will take a list of path substitution pairs and work only for the active Nuke session, or set a filenameFilter callback in your init.py file to have it persistent across all Nuke sessions.

Current Nuke session

Here is an example of how the flag is used when running Nuke in Terminal Mode: