Manage dependencies for a Databricks app
Define additional Python libraries for a Databricks app using a requirements.txt
file. If any listed packages match pre-installed ones, the versions in your file override the defaults.
For example, the following requirements.txt
file pins specific versions and adds libraries beyond the pre-installed set:
# Override default version of dash
dash==2.10.0
# Add additional libraries not pre-installed
requests==2.31.0
numpy==1.24.3
# Specify a compatible version range
scikit-learn>=1.2.0,<1.3.0
Pre-installed Python libraries
The following Python libraries are pre-installed in the Databricks app environment. You don’t need to include them in your app unless you require a different version.
Library | Version |
---|---|
databricks-sql-connector | 3.4.0 |
databricks-sdk | 0.33.0 |
mlflow-skinny | 2.16.2 |
gradio | 4.44.0 |
streamlit | 1.38.0 |
shiny | 1.1.0 |
dash | 2.18.1 |
flask | 3.0.3 |
fastapi | 0.115.0 |
uvicorn[standard] | 0.30.6 |
gunicorn | 23.0.0 |
dash-ag-grid | 31.2.0 |
dash-mantine-components | 0.14.4 |
dash-bootstrap-components | 1.6.0 |
plotly | 5.24.1 |
plotly-resampler | 0.10.0 |
Version conflicts
Keep the following in mind when you define dependencies:
- Overriding pre-installed packages may cause compatibility issues if your specified version differs significantly from the pre-installed one.
- Always test your app to ensure that package version changes don't introduce errors.
- Pinning explicit versions in
requirements.txt
helps maintain consistent app behavior across deployments.