This article walks you through the steps required to upload libraries or requirements.txt files to volumes and install them onto clusters in Databricks. You can install libraries onto all-purpose compute or job compute.
For more information about volumes, see What are Unity Catalog volumes?. For information about working with Unity Catalog, including controlling access and creating objects, see What is Unity Catalog?.
For full library compatibility details, see Compute-scoped libraries.
Load libraries to a volumeâTo load a library to a volume:
When you install a library onto a cluster, all notebooks running on that cluster have access to the library.
To install a library from a volume onto a cluster:
/Volumes/<catalog>/<schema>/<volume>/<path-to-library>/<file-name>.<ext>
.To configure a workflow task with a dependent library from a volume:
/Volumes/<catalog>/<schema>/<volume>/<path-to-library>/<file-name>.<ext>
.You can install Python libraries directly to a notebook to create custom Python environments that are specific to the notebook. For example, you can use a specific version of a library in a notebook, without affecting other users on the cluster who may need a different version of the same library. For more information, see notebook-scoped libraries.
When you install a library to a notebook, only the current notebook and any jobs associated with that notebook have access to that library. Other notebooks attached to the same cluster are not affected.
The following code shows how to install a Python wheel file from a volume to a notebook as a notebook-scoped library.
Python
%pip install /Volumes/<catalog>/<schema>/<volume>/<path-to-library>/mypackage-0.0.1-py3-none-any.whl
or
Python
%pip install /Volumes/<catalog>/<schema>/<volume>/<path-to-project>/requirements.txt
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4