CertSafari
    Databricks Certified Data Engineer Professional· Lessons

    Domain 1 · Lesson 2/46

    Troubleshooting serverless library installs: paths, architecture, private repos and %pip

    Apply troubleshooting techniques to dependency conflicts and installation failures for external libraries (PyPI, local wheels, source archives) across serverless, pipeline, and bundle-deployed environments.

    11 min read
    1.92% of exam
    3 sources
    Published 3 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Explain why serverless dependencies must be declared in the Environment side pane and not fixed from inside notebook code
    • Diagnose wheel, path, CPU-architecture, private-repository and PySpark installation failures on serverless compute
    • Use pip logs, %pip and %uv pip to investigate dependency conflicts, and know where each one stops working

    Key concept

    Dependencies resolve before code runs — On Databricks, the environment you declare decides which external libraries get installed, and it is resolved before any of your code executes. Changing things at runtime, such as proxy variables in a cell or restarting Python in a pipeline, does not change what was installed. You fix the declaration instead.

    1.Where serverless dependencies come from

    On classic clusters you might reach for an init script or a compute policy when a library will not install. Serverless compute supports neither, so the Environment side pane is the only place to declare custom dependencies. It has two layers. The base environment (Standard, ML, AI, a previous version, a Custom YAML file, or an admin-configured workspace environment) sets the preinstalled libraries and environment version. Your Dependencies list sits on top of it. For a job task, you configure the same environment when you create or edit the task.

    This changes how you troubleshoot. Databricks resolves the environment before your code starts, so nothing you write in a cell can rescue a failed install. The fix is always to change the declaration: a different version, path, index or base environment. Then click Apply, which installs the dependencies and restarts the Python process. Databricks also caches the notebook's virtual environment, and job tasks that share the same dependency set reuse that cache within a run. Reopening the notebook does not reinstall anything, so a broken declaration stays broken until you edit it.

    Checkpoint 1 of 7· Check yourself

    A serverless notebook dependency fails to install. Which approach can actually fix it?

    Sources1

    2.PyPI specs, local wheels and project directories: getting the path right

    Each entry in the Dependencies list accepts any format that is valid in a requirements.txt file. That covers three source types:

    - PyPI packages such as simplejson==3.19.*. - Local wheel files stored in workspace files or Unity Catalog volumes. - Python project directories, meaning a folder containing a pyproject.toml or a setup.py. Databricks builds and installs the project from source.

    Many "file not found" failures come down to path syntax. A workspace path must be absolute and start with /Workspace/. A volume path follows /Volumes/<catalog>/<schema>/<volume>/<path>.whl. The documented helper-utils example adds the folder /Workspace/helper_utils, which holds a pyproject.toml and a helpers package, and then runs from helpers import greet. That example also requires other users to have read access to the folder, so a missing permission is one more thing to check when an install works for its author and fails for everyone else.

    A note on scope: these sources do not describe installing packaged source archives (for example .tar.gz sdists) directly. For source-based installs, they document project directories that have a pyproject.toml/setup.py, and git+https:// VCS URLs installed with %pip.

    Checkpoint 2 of 7· Check yourself

    A dependency entry reads Shared/libs/etl_utils-1.0-py3-none-any.whl and fails to install on a serverless notebook. What is the most likely fix?

    Sources1

    3.The wheel that installed yesterday: CPU architecture

    Serverless compute does not guarantee a CPU architecture. A notebook or job can land on aarch64 or x86_64, and that can change between runs. A wheel with native (C) extensions ships a prebuilt binary for one architecture, so it installs on matching hardware and fails with an error on the other. That produces intermittent failures that look unrelated to any change you made.

    The documentation gives two fixes. Use pure-Python wheels tagged py3-none-any where possible, since they have no architecture-specific binary. Otherwise, supply both an aarch64 and an x86_64 variant and limit each to its own architecture with a platform_machine environment marker.

    Checkpoint 3 of 7· Check yourself

    Which change stops a native-extension wheel from failing intermittently on serverless?

    Sources1

    4.Private indexes, PySpark collisions and reading the pip logs

    Private repositories. Engineers behind a corporate proxy often set proxy variables in a cell and retry. On serverless this fails twice over: installation happens before cell code runs, and serverless has no compute-scoped environment variables. Put index-url or extra-index-url in the dependency specification, or ask a workspace admin to configure the repository as a default package repository for serverless notebooks and jobs.

    PySpark. Never install PySpark, or any library that brings PySpark in as a dependency. Doing so stops the session with an error. To recover, remove the library and reset the environment.

    Unpinned versions. If a version is not fully specified, Databricks installs the latest matching version. Two runs of the same job can therefore get different library versions, so a job that breaks with no code change may be picking up a new upstream release. Pin versions for jobs.

    Evidence. The Installed tab lists what actually got installed. pip logs at the bottom of the Environment pane show the resolver output, which is where a conflict or a missing wheel shows up.

    Serverless install failures: symptom, cause, fix
    SymptomCauseFix
    Wheel install fails on some runs onlyNative wheel built for one architecture; compute may be aarch64 or x86_64py3-none-any wheel, or both variants with a platform_machine marker
    Private package not found despite proxy set in a cellDependencies resolve before code runs; no compute-scoped environment variablesindex-url / extra-index-url in the spec, or an admin-configured default package repository
    Session stops with an error after adding a libraryLibrary installs PySpark as a dependencyRemove the library and reset the environment
    Workspace wheel or project not foundPath not absoluteUse /Workspace/... or /Volumes/<catalog>/<schema>/<volume>/...

    Checkpoint 4 of 7· Match them up

    Match each serverless symptom to the correct remedy

    Tap a term, then the definition that fits it.

    Checkpoint 5 of 7· Exam question

    A data engineer configures a serverless notebook and runs `%pip install some-ml-library`, where the library pulls in `pyspark` as a transitive dependency. Immediately after the cell finishes, the notebook session terminates and must be reattached. What is the most likely cause, and how should the engineer avoid it?

    Sources12

    5.Interactive debugging with %pip and %uv pip, and where they fall short

    For quick experiments, notebook-scoped installs let you try versions without editing the environment. They come with caveats you need to know when troubleshooting:

    - %pip does not restart Python on its own. After an install or upgrade, you may need dbutils.library.restartPython() before the new version is visible. - Upgrading, modifying or uninstalling core packages such as IPython with %pip can break notebook features. Reset by restarting the cluster or starting a new session. - %pip uninstall -y cannot remove a library bundled with the runtime. It only reverts an override back to the bundled version. - %uv pip (serverless environment version 5 or above) is faster and shares the same virtual environment as %pip. It does not check for dependency conflicts against preinstalled libraries, and its uninstall removes only the metadata of a preinstalled package, which stays importable.

    For private repositories, %pip accepts --index-url, with the token pulled from Databricks Secrets:

    Installing from an authenticated private index with %pip, falling back to PyPIpython
    %pip install --index-url https://<user>:$token@<your-package-repository>.com/<path/to/repo> <package>==<version> --extra-index-url https://pypi.org/simple/

    Once an experiment works, move the dependency into the Environment side panel. That panel is the reproducible definition, and %uv pip is meant only for fast iteration.

    Checkpoint 6 of 7· Check yourself

    You run %uv pip install to upgrade a package, it reports success, and imports then fail with a version clash against a preinstalled library. Why didn't the install catch it?

    Checkpoint 7 of 7· Exam question

    A team deploys a job via a Declarative Automation Bundle with a `python_wheel_task` targeting serverless compute. The task references a `requirements.txt` file listing the project's third-party dependencies, but every run fails with an error stating the library file cannot be located or read. Which of the following changes would correctly resolve the failure? (Select 3.)(Select 3)

    Sources3

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.Setting HTTP proxy variables in a serverless notebook cell will let dependencies install from a private repository.Why is that wrong?

      Dependencies resolve before code runs and serverless has no compute-scoped environment variables. Use index-url/extra-index-url in the spec, or an admin-configured default repository.

      Covered in Private indexes, PySpark collisions and reading the pip logs

    2. 2.%uv pip uninstall fully removes a preinstalled serverless library so you can replace it cleanly.Why is that wrong?

      Only the metadata is removed. The files stay on disk and the package can still be imported.

      Covered in Interactive debugging with %pip and %uv pip, and where they fall short

    3. 3.If a native wheel installed successfully once on serverless, it will keep installing on later runs.Why is that wrong?

      Serverless can run on aarch64 or x86_64, and that can change between runs, so an architecture-specific wheel can fail on the next run.

      Covered in The wheel that installed yesterday: CPU architecture

    Sources

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Code in a notebook cell cannot change how dependencies are fetched.”
      ↩︎ Where serverless dependencies come from
      “Python projects (for example, the directory containing a pyproject.toml or a setup.py) can be located in workspace files or Unity Catalog volumes.”
      ↩︎ PyPI specs, local wheels and project directories: getting the path right
      “You can specify a dependency in any format that is valid in a requirements.txt file.”
      ↩︎ PyPI specs, local wheels and project directories: getting the path right
      “Serverless compute does not guarantee a specific CPU architecture.”
      ↩︎ The wheel that installed yesterday: CPU architecture
      “To install from a private or authenticated package repository, specify index-url or extra-index-url in the dependency specification.”
      ↩︎ Private indexes, PySpark collisions and reading the pip logs
      “Do not install PySpark or any library that installs PySpark as a dependency on your serverless notebooks.”
      ↩︎ Private indexes, PySpark collisions and reading the pip logs
      “Databricks resolves and installs dependencies before your notebook or task code runs.”
      ↩︎ Key concept
      “proxy settings applied at runtime have no effect on dependency installation.”
      ↩︎ Exam trap 1
      “A wheel built for one architecture fails to install on another, returning an error.”
      ↩︎ Exam trap 3
      “Because serverless does not support compute policies or init scripts, you must install custom dependencies using the Environment side pane.”
      ↩︎ Prediction
      “If using a workspace file, the path should be absolute and start with /Workspace/.”
      ↩︎ Checkpoint
      “use pure-Python wheels (tagged py3-none-any) where possible, or include both aarch64 and x86_64 wheel variants”
      ↩︎ Checkpoint
      “proxy settings applied at runtime have no effect on dependency installation.”
      ↩︎ Checkpoint
    2. 2.
      “different runs of the same job might use different library versions as new versions are published.”
      ↩︎ Private indexes, PySpark collisions and reading the pip logs
    3. 3.
      “%pip commands do not automatically restart the Python process.”
      ↩︎ Interactive debugging with %pip and %uv pip, and where they fall short
      “To set up a reproducible environment for the notebook, add dependencies in the notebook's Environment side panel.”
      ↩︎ Interactive debugging with %pip and %uv pip, and where they fall short
      “Only the package metadata is removed. The underlying files remain on the file system, and the package is still importable.”
      ↩︎ Exam trap 2
      “%uv pip does not check for dependency conflicts against preinstalled libraries.”
      ↩︎ Checkpoint

    Continue to page 2 of 2

    Fixing library dependencies in Lakeflow pipelines and bundle deployments

    Spotted a mistake, or was something unclear? Tell us.