Skip to content

Installing libraries on a compute resource

Libraries add third-party or custom code (Python, JAR, R, etc.) to a cluster so notebooks and jobs can import them. Libraries can be installed at the cluster (compute) level or scoped to a notebook session, and can come from PyPI, Maven, CRAN, workspace files, Unity Catalog volumes, or uploaded files.

1 · Learn the must-know

  • Cluster-installed libraries are available to all notebooks attached to that cluster and are reinstalled automatically on cluster restart.
  • Notebook-scoped libraries (installed via %pip or %conda magic commands) apply only to the current notebook session and do not persist across cluster restarts or affect other users on shared clusters.
  • Library sources include PyPI, Maven Central, CRAN, workspace files, Unity Catalog volumes, and DBFS/direct file upload, selectable from the cluster's Libraries tab.
  • Installing a library on a running cluster may require the cluster to restart or the library to be reinstalled to take effect on all nodes, especially for JAR/init-script based libraries.
  • Library conflicts (version mismatches between cluster-installed and notebook-scoped libraries) can cause import errors, so notebook-scoped %pip installs are recommended for isolating dependencies per workload.
  • On job clusters, libraries can be specified as part of the job/task definition so the correct dependencies are installed automatically each time the ephemeral cluster starts.

2 · Check your understanding

Check this objectiveFree · always available

A data engineering team wants a custom Python package to be automatically available to every notebook attached to a shared all-purpose cluster, without requiring each notebook author to run an install command. Which approach satisfies this requirement?

Your objective map0 tried · 0 answered correctly · 77 untouched

What you have tried across DP-750's objectives, not a readiness score.

Set up and configure an Azure Databricks environment15-20% of the exam0 of 13 tried
Secure and govern Unity Catalog objects15-20% of the exam0 of 12 tried
Prepare and process data30-35% of the exam0 of 28 tried
Deploy and maintain data pipelines and workloads30-35% of the exam0 of 24 tried

3 · Keep going