Hi @laval –
To help create reusable nodes written either partially or entirely in Python, a Component can provide a convenient way of encapsulating your nodes and functionality with a Conda Environment Propagation node. This ensures portability of your Component – if used on a system where all the Python dependencies are already satisfied, the Conda Environment Propagation node does nothing, but if used on a system where dependencies are absent, it recreates an env with the required dependencies.
The goals of portability and reusability are achievable when all dependencies are specified as part of any node or Component. The cost of creating yet another conda env on disk, especially when only the minimal required dependencies are used to define the conda env, is generally expected to be small enough that it will not be a concern. Unless you have an exceptionally large conda env?
There is currently no node for the purpose of adding a single package to an existing conda env (and no node to first investigate if that package is already installed, and no node to remove a package, etc.) but I can offer the following options to achieve this:
- use the conda API in a Python Script node
- use the External Tool node to invoke conda commands directly
I hope what I wrote provides some encouragement to further consider using the Conda Environment Propagation node to ensure all dependencies are satisfied for a node/Component. If that is still not a good fit for your situation, I would be very interested to hear more about it but I will also encourage looking at the conda API before looking at the option of the External Tool node.
Hope this helps,