I was wondering if there is a way to restart the ipython kernel without closing it, like the kernel restart function that exists in the notebook. I tried %reset
but that doesn't seem to clear the imports.
You can restart your Jupyter Kernel by simply clicking Kernel > Restart from the Jupyter menu. Note: This will reset your notebook and remove all variables or methods you've defined! Sometimes you'll notice that your notebook is still hanging after you've restart the kernel. If this occurs try refreshing your browser.
Open spyder. Create any variable in the console (this step is not necessary). Choose "Restart kernel" option from the console "hambrger icon". Accept by pressing "OK".
Restarting your kernel will reset your Jupyter notebook and remove all variables or methods you have defined. You will not lose the code written by you. Just that, you have to run all the code cell again to set the variables and methods.
Note: you may need to restart the kernel to use updated packages.
Even though it would be handy if %reset
would clear the namespace and the cache for the imports (as in the notebook) one can explicitly reload a previously imported module using importlib.reload
in python3.4 or imp.reload
in python3.0-3.3 (and if needed reset the kernel in a second step).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With