How can you chose the kernel in Jupyter Notebook when executing from other python script

Viewed 35

I have a python script that executes a Jupyter notebook. But every time it takes the default kernel, which is python3. The relevant code line in the python script is this here:

os.system('jupyter nbconvert  --execute {:s} --to html'.format(IPYNB_FILENAME))

I have tried to change the default kernel in the jupyter_notebook_config.py file, but without success.

Any ideas how to solve this?

1 Answers

From the docs here it looks like you can do it like this:

jupyter nbconvert --ExecutePreprocessor.kernel_name=python3  --execute

etc

Related