Error running a magic programmatically via IPython’s run_cell_magic Consider the following program, which I wrote in two Jupyter Notebook cells.