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:Ā 

Trying to use Python source file as module in databricks Notebook

adhi_databricks
Visitor

Hi everyone,

Iā€™m currently working on a project in Databricks(version 13.3 LTS) and could use some help with importing external Python files as modules into my notebook. Iā€™m aiming to organize my code better and reuse functions across different notebooks.

Could someone please provide detailed steps or best practices for this? Are there any specific configurations I should be aware of, or recommended file structures?ā€ƒ

Hereā€™s the structure Iā€™m working with:

 

 
test/ ā”œā”€ā”€ Code/ ā”‚ ā””ā”€ā”€ notebook ā””ā”€ā”€ utils/ ā””ā”€ā”€ utilities.py

I need to import functions from utilities.py to use them in my notebook. However, Iā€™m encountering a "module not found" error when I try to do this.

Thanks for your assistance!

0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonā€™t want to miss the chance to attend and share knowledge.

If there isnā€™t a group near you, start one and help create a community that brings people together.

Request a New Group