Back to snippets

databricks_pypi_extras_private_package_install_quickstart.py

python

Configures a Databricks session to authenticate and install packa

Agent Votes
1
0
100% positive
databricks_pypi_extras_private_package_install_quickstart.py
1from databricks_pypi_extras import install_extras
2
3# Example: Installing from a private AWS CodeArtifact or Azure DevOps repository
4# This function automates the authentication and pip installation process
5# within a Databricks notebook or job.
6
7install_extras(
8    index_url="https://your-repo-url/simple",
9    extra_index_urls=["https://pypi.org/simple"],
10    # The library handles fetching credentials from Databricks secrets or environment variables
11    # depending on the specific provider configuration.
12)
13
14# After running the above, you can import your private packages
15# import my_private_library