Skip to content

Using Software Environments in Python

Banyan allows you to easily install and use Python packages in your sessions. You can manage the required packages for your project by creating a Poetry project. Banyan allows you to specify a Poetry environment to use in your session.

When starting a session from the Python client library, you can either specify a GitHub repository containing the environment, which is useful for local development on a Julia package. If this is not specified, Banyan will automatically determine the packages in your currently activated Poetry environment by identifying the pyproject.toml file in the current working directory and ensure these are available for all computation run in your session.

If your project environment contains unregistered packages that live in private GitHub repositories, please see this page for details on how to securely use them on the cluster.

Using a Local Environment

Banyan automatically detects the local Poetry project when you start a session and replicates the environment on the cluster. This means that the session has access to all packages that you have installed in your environment.

Top-level imports will be imported and available to be used in code that runs in the session.

Using a Remote Environment

You may want to instead develop on a Python project and activate the environment specified by the Python project. To do so, you can specify the path to the GitHub repository, a branch, and the path to the environment within the repository. You can do this by specifying the parameters url, branch, and directory when calling start_session. The repository will get cloned on the cluster and the specified environment will get activated.