I am trying to develop an Azure function app that executes jupyter notebooks stored in blob storage through papermill. It's all working up until the point of papermill.execute_notebook(...)
where I then get the following error:
File "/home/site/wwwroot/.python_packages/lib/site-packages/jupyter_client/kernelspec.py", line 287, in get_kernel_spec
raise NoSuchKernel(kernel_name)
jupyter_client.kernelspec.NoSuchKernel: No such kernel named python3
For testing purposes, I am doing a very simple notebook that just accepts two parameters ["name", "age"] and inserts them into a sql table. My code below (written in python 3.8) is simply passing a name and age into the papermill.execute_notebook(<notebook_path>)
. I have tested that notebook and it works fine. It's just when I try and run it through papermill, I get the error "No such kernel named python3".
blob_service_client = BlobServiceClient.from_connection_string(connection_string)
with tempfile.NamedTemporaryFile(delete=False, suffix=".ipynb") as temp_notebook:
blob_client = blob_service_client.get_blob_client(container=container, blob=blob_path)
temp_notebook.write(blob_client.download_blob().readall())
input_notebook_path = temp_notebook.name
output_notebook_path = '/tmp/output_notebook.ipynb'
papermill.execute_notebook(
input_path=input_notebook_path,
output_path=output_notebook_path,
parameters=dict(name='Prince', age='99')
)
Any advice would be much appreciated.