Can I configure Knime to recognize my PYTHONPATH?

I would like to pull in some custom modules that are currently in my PYTHONPATH to be run in a Python Script Node. Can I get Knime to recognize my PYTHONPATH? Maybe a batch script that activates the conda environment and then an export PATH statement?

@mbishopp welcome to the KNIME forum. You can import custom modules. I have set up this example. Here you append the path to your module to the sys path.

1 Like

@mlauber71 Thanks for that. I am wondering if my PYTHONPATH can be used. It is simpler that way based on whatever machine the script is running on.

I tried os.environ[‘PYTHONPATH’] = , but this did not work.

Obviously, the way you set up the script is to have any of my custom modules in a location called scripts that is a directory directly undernees the knime absolute path. Not sure this is the way I want to go.

Should I just modify your script to include my python script location? I’ll do that, but I was hoping to use PYTHONPATH