
Explanation:
To install a Python package scoped at the notebook level to all nodes in the active cluster, the correct method is using %pip install in a notebook cell. This installs the package in the current Spark session, making it available only to the notebook's session and not cluster-wide.
%sh pip install, which installs packages system-wide on worker nodes, affecting other notebooks and potentially causing permission issues.%pip install, which isolates the package to the notebook's execution context.Ultimate access to all questions.
What is the method for installing a Python package at the notebook level that will be available on all nodes of the active cluster?
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
No comments yet.