Databricks Certified Data Engineer Professional — Question 123
What is a method of installing a Python package scoped at the notebook level to all nodes in the currently active cluster?
Answer options
- A. Run source env/bin/activate in a notebook setup script
- B. Install libraries from PyPI using the cluster UI
- C. Use %pip install in a notebook cell
- D. Use %sh pip install in a notebook cell
Correct answer: C
Explanation
The correct answer is C, as using %pip install in a notebook cell allows for the installation of Python packages directly within the notebook's environment, affecting all nodes in the active cluster. Options A and D involve running shell commands, which are not specifically designed for Python package installation in this context, while option B is more general and does not specify the notebook-level scope.