Apparently it doesn't work with /usr/bin/env and spawning (?), so make sure to get the absolute path of python in the shebang. Make sure to make generated scripts executable and distcleaned.