I'm given a notebook
to run in Azure Databricks
. I imported the notebook to my user folder Workspace\Users\[email protected]
. Following command in the notebook gives the error shown below.
Question: Where is the referenced notebook qc_notebook
located in Databricks?
My notebook that I am running following command on is at Workspace\Users\[email protected]
location in Databricks:
%run ../../qc_functions
Error:
Notebook not found: qc_functions. Notebooks can be specified via a relative path (./Notebook or ../folder/Notebook) or via an absolute path (/Abs/Path/to/Notebook). Make sure you are specifying the path correctly. Stacktrace: /Users/[email protected]/myNotebook: python
%run
only supports to run databricks notebooks and not for python script files(.py
)When you import
.py
file it automatically converts it to notebook type, try checking it if it is still showing as.py
then follow below steps to convert it.Convert the script file as notebook by adding below comments in it.
Add above comment at the starting of the file, and
For creating cell.
Below is the code i have added in my
.py
file and imported it in databricks workspace.If it is converted to notebook type, then run below command.
Output:
Refer this for more information.