stbjelcevic
Databricks Employee
Databricks Employee

Hi @axelboursin ,

I think this article will help you out: https://docs.databricks.com/aws/en/admin/workspace-settings/default-python-packages (option 1 below).

Recommended approaches (choose based on your environment):

  • For broad, consistent behavior across clusters and notebooks, configure workspace-level default Python package repositories to point to CodeArtifact; this avoids per-notebook tokens and works for both serverless and classic compute.

  • (The thing you mentioned) For classic clusters only, add a cluster-scoped init script that runs aws codeartifact login and writes pip config, so pip automatically resolves from your CodeArtifact repo at cluster start.

  • For one-off installs or testing, use notebook-scoped %pip with --index-url (and --extra-index-url as needed) and credentials pulled from Databricks Secrets inside the notebook.