cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster install of Python libraries versus notebook install

lmorrissey
New Contributor II

If a base set of libraries is installed on the cluster and pinned to a specific version, can/would this conflict with a notebook submitted to the cluster that defines a conflicting set of libraries for install?
Is there a way to override the cluster python env via modifying the PYTHONPATH or some other Databricks variable in these cases or some order of precedence?

1 ACCEPTED SOLUTION

Accepted Solutions

Alberto_Umana
Databricks Employee
Databricks Employee

When a base set of libraries is installed on a cluster, can indeed conflict with a notebook submitted to the cluster that defines a conflicting set of libraries for installation. This is because the libraries installed at the cluster level take precedence over those specified in the notebook. 

If you need to use custom Python libraries or modules, the recommended approach is to install the required libraries directly to the cluster using the cluster library installation feature. This ensures that the libraries are available to all notebooks running on the cluster.

 
About your pythonpath variable, please see;

https://kb.databricks.com/en_US/clusters/cannot-set-a-custom-pythonpath

View solution in original post

1 REPLY 1

Alberto_Umana
Databricks Employee
Databricks Employee

When a base set of libraries is installed on a cluster, can indeed conflict with a notebook submitted to the cluster that defines a conflicting set of libraries for installation. This is because the libraries installed at the cluster level take precedence over those specified in the notebook. 

If you need to use custom Python libraries or modules, the recommended approach is to install the required libraries directly to the cluster using the cluster library installation feature. This ensures that the libraries are available to all notebooks running on the cluster.

 
About your pythonpath variable, please see;

https://kb.databricks.com/en_US/clusters/cannot-set-a-custom-pythonpath

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now