
Ultimate access to all questions.
Which describes a method of installing a Python package scoped at the notebook level to all nodes in the currently active cluster?
A
Run source env/bin/activate in a notebook setup script
B
Use b in a notebook cell
C
Use %pip install in a notebook cell
D
Use %sh pip install in a notebook cell
E
Install libraries from PyPI using the cluster UI
Explanation:
In Databricks, there are several ways to install Python packages, but the question specifically asks for a method that installs packages scoped at the notebook level to all nodes in the currently active cluster.
Let's analyze each option:
A. Run source env/bin/activate in a notebook setup script
B. Use b in a notebook cell
b command for installing packages in DatabricksC. Use %pip install in a notebook cell ✓ CORRECT
%pip install magic command installs packages at the notebook levelD. Use %sh pip install in a notebook cell
%sh magic command to run shell commandsE. Install libraries from PyPI using the cluster UI
Key Points:
%pip install is the magic command specifically designed for notebook-scoped package installation