Local dependencies#

During the development cycle you will want to be able to run your workflows both locally on your machine and remotely on Union. To enable this, you need ensure that the required dependencies are installed in both places. Here we will explain how to install your dependencies locally. For information on how to make your dependencies available on Union, see Remote dependencies with ImageSpec.

Create a Python virtual environment#

We recommend using a Python virtual environment to manage your project dependencies. For example, too create a new virtual environment using conda, run the following command:

$ conda create --name basic-example-env python=3.11
$ conda activate basic-example-env

Note

You can also use other tools, like venv to create and manage your virtual environments.

Install the local dependencies#

Make sure that you have activated your basic-example-env environment, then install the dependencies from requirements.txt:

$ pip install -r requirements.txt

The requirements.txt generated by the union init command should look like this:

union

It simply specifies the union package (which in any case, you have already installed locally). In an actual project you would specify all the other dependency packages here as well.

Having installed your dependencies in your local environment, you can now run your workflows locally using union run.

The next step is to ensure that the same dependencies are also available in the remote environment on Union.