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
To use this workflow in KNIME, download it from the below URL and open it in KNIME:
Download WorkflowDeploy, schedule, execute, and monitor your KNIME workflows locally, in the cloud or on-premises – with our brand new NodePit Runner.
Try NodePit Runner!Do you have feedback, questions, comments about NodePit, want to support this platform, or want your own nodes or workflows listed here as well? Do you think, the search results could be improved or something is missing? Then please get in touch! Alternatively, you can send us an email to mail@nodepit.com.
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.