This workflow shows how a custom Python library can be shared with a KNIME workflow, by including the sources.
There is one Python file in this workflow's data area (the ./data folder inside the workflow on disk).
In the Python Script node, we add the data area to the Python path and import the module stored there.
One could do the same for any pure-Python library.
(To make workflow sharing work across operating systems, if the library needs different installations on different systems one would have to build some logic here to import the right module per OS.)
Further example workflows for this setup:
https://hub.knime.com/paolotamag/spaces/Public/latest/Storing_Data_Files_inside_the_Workflow_Data_Area~5NLgbd3FSmvs55-T
https://hub.knime.com/mlauber71/spaces/Public/latest/kn_example_python_import_module~BQEN92dR6W0cUM8R
Used extensions & nodes
Created with KNIME Analytics Platform version 4.6.0 Note: Not all extensions may be displayed.
- Go to item
- Go to item
- Go to item
- Go to item
Legal
By using or downloading the workflow, you agree to our terms and conditions.