Deliver workflow with a python module (to be imported)

python

#1

Hi all,
I have written a python script/module that contains some functions that I would use in my python nodes by importing this script/module.
For this to work, I just need to have the script/module in the python path.
This is fine for one machine.

However if I want to deliver my workflow, I can send it with the python module, but how to make sure that it will be visible for import (ie located in the python path).
As a comparison with Fiji, I would put this module in Fiji.app/Jars/Lib since this folder is in the jython path by default.

I was thinking of using the Extract System Properties node to extract the path to the workflow folder and manually add it to the python path (with the idea that the python module would reside in the workflow folder too).
Yet there are many entries in System Properties, but none of them looks like what I am looking for.

Is there a simpler solution than this one : Deploy Workflow with external jar and python scripts


#2

Hi L.Thomas,

You are going in the right direction, try Extract Context Properties node. This way you will get the path to the workflow as one of the variables.

Hope it helps.
Best, Daria