Actually no, in the docs is says use #!/usr/bin/env python to run python, but examples are just #!/bin/bash.
I also looked at the test code, that is only testing #!/bin/bash
Then I took a peek at the RunScript code itself. It creates a temp file with the contents in the window, makes that file executable and runs it with popen. You can actually run any script code in there, bash, python, perl, csh and so one
A colleague spotted the real problem, it is the environmental variables that are set for python, namely PYTHONNOUSERSITE and PYTHONPATH. Unless you are using Natron’s python, a python script will fail when it tried to load Natron’s python libraries.
The best fix is the following: #!/usr/bin/env -S -uPYTHONNOUSERSITE -uPYTHONPATH python3
And you are in business.
This unset those variables and the -S does some other magic.