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: 

How can I use custom python library in Azure Databricks?

Jon
New Contributor II

I am trying to access functions in my coreapi.py by importing in the main notebook, but I have error

ModuleNotFoundError: No module named 'coreapi'. I tried by uploading the file into the same folder and I tried creating a python egg and uploading it. How can i import my python library?

3 REPLIES 3

Prabakar
Esteemed Contributor III
Esteemed Contributor III

Hi @Jon, you need to install the library on the cluster. Please refer to the below document.

https://docs.databricks.com/libraries/cluster-libraries.html#install-a-library-on-a-cluster

Hubert-Dudek
Esteemed Contributor III

When you go to cluster to edit or you edit individual task you can add own library:image

-werners-
Esteemed Contributor III

There is also the possibility to use Repos file functionality:

https://databricks.com/blog/2021/10/07/databricks-repos-is-now-generally-available.html

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!