Databricks provides tools to install libraries from PyPI, Maven, and CRAN package repositories.
Default behavior for the library upload UI has changed. Legacy behavior always stored libraries in the DBFS root. All workspace users have the ability to modify data and files stored in the DBFS root.
The default location for library uploads is now workspace files. Databricks recommends uploading libraries to workspace files or Unity Catalog volumes, or using library package repositories. If your workload does not support these patterns, you can also use libraries stored in cloud object storage.
In the Library Source button list, select PyPI.
Enter a PyPI package name. To install a specific version of a library, use this format for the library:
<library>==<version>. For example,
For jobs, Databricks recommends that you specify a library version to ensure a reproducible environment. If the library version is not fully specified, Databricks uses the latest matching version. This means that different runs of the same job might use different library versions as new versions are published. Specifying the library version prevents new, breaking changes in libraries from breaking your jobs.
(Optional) In the Index URL field enter a PyPI index URL.
To install Maven libraries on compute configured with shared access mode, you must add the coordinates to the allowlist. See Allowlist libraries and init scripts on shared compute.
In the Library Source button list, select Maven.
Specify a Maven coordinate. Do one of the following:
In the Coordinate field, enter the Maven coordinate of the library to install. Maven coordinates are in the form
groupId:artifactId:version; for example,
If you don’t know the exact coordinate, enter the library name and click Search Packages. A list of matching packages displays. To display details about a package, click its name. You can sort packages by name, organization, and rating. You can also filter the results by writing a query in the search bar. The results refresh automatically.
Select Maven Central or Spark Packages in the drop-down list at the top left.
Optionally select the package version in the Releases column.
Click + Select next to a package. The Coordinate field is filled in with the selected package and version.
(Optional) In the Repository field, you can enter a Maven repository URL.
Internal Maven repositories are not supported.
In the Exclusions field, optionally provide the
artifactIdof the dependencies that you want to exclude (for example,
In the Library Source button list, select CRAN.
In the Package field, enter the name of the package.
(Optional) In the Repository field, you can enter the CRAN repository URL.
CRAN mirrors serve the latest version of a library. As a result, you may end up with different versions of an R package if you attach the library to different clusters at different times. To learn how to manage and fix R package versions on Databricks, see the Knowledge Base.