I have connected a Github repository to my Databricks workspace, and am trying to import a module that's in this repo into a notebook also within the repo. The structure is as such:
Repo_Name
The path to this repo is in my sys.path(), yet I still get ModuleNotFoundError: No module named 'Checks'
. When I try to do import Checks
. This link explains that you should be able to import any modules that are in the PATH. Does anyone know why it might still not be working?
Most probably your .py
file is a notebook, not a Python file. Notebooks couldn't be imported as Python modules, only Python files could be used in this case.
You can check if this .py
has the following text in the first line:
# Databricks notebook source
If it contains, you can remove this line, and file will be considered as Python file, not as a notebook.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With