1

I have uploaded my databricks notebooks to a repo and replace %run sentences with import using the new databrick public available features (Repo integration and python import): https://databricks.com/blog/2021/10/07/databricks-repos-is-now-generally-available.html

But its seems its not working

I already activate the repo integration option in the Admin panel but i Get this error

ModuleNotFoundError: No module named 'petitions'

For simplicity I moved all python files to the same directory. I get the error in the procesado notebook

[Repo structure1

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
Nasgar
  • 859
  • 2
  • 11
  • 26

2 Answers2

0

Please try to use full path to file from repo root:

from folders.file import class
Hubert Dudek
  • 1,666
  • 1
  • 13
  • 21
0

If your are using Azure DataBricks and Python Notebooks, you can't import them as modules.

From the documentation:

If you want to import the notebook as a Python module, you must edit the notebook in a code editor and remove the line # Databricks Notebook source. Removing that line converts the notebook to a regular Python file.

Documentation: https://learn.microsoft.com/en-us/azure/databricks/repos#work-with-python-and-r-modules

user3342784
  • 103
  • 1
  • 1
  • 4