QuestionQ148

VerifiedDebugging and Deploying

A data engineer is working in a Databricks notebook that needs several third-party Python libraries. Some are available on PyPI, while others are custom-developed and stored as local.wheel (.whl) and source (.tar.gz) files in an S3 bucket. The objective is to ensure that every dependency is installed and available correctly across multiple jobs running on any automated cluster in a Unity Catalog-enabled workspace. The engineer must install the dependencies in a way that provides a consistent environment across interactive notebooks and jobs while complying with workspace security policies (no internet access).

Which approach should the engineer use to install and manage these dependencies while ensuring reproducibility and compliance?

Explanation

A versioned project wheel and pinned dependency definition provide a repeatable dependency set that can be deployed with the workload. Databricks supports installing libraries from Workspace Files or Unity Catalog volumes on compute and workflow tasks; Unity Catalog volumes provide governed access to the artifacts. This avoids relying on public PyPI at runtime and makes the same approved dependency versions available to interactive compute and automated job clusters. Notebook-scoped %pip environments do not persist across sessions, and Databricks does not recommend using init scripts to install libraries.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!