简体   繁体   中英

Is there any way of restarting the kernel safely without losing things saved in Python Jupyter Notebook?

I can't import statsmodels.api in Jupyter Notebook anymore. I thought that it requires updating statsmodels.api. Then I typed "Conda update statsmodels.api". Then, the message comes up below.

PackageNotInstalledError: Package is not installed in prefix. prefix: XXX package name: statsmodels.api

Note: you may need to restart the kernel to use updated packages.

In order to update statsmodels.api, it seems that it would require restarting the kernel. But when trying to restart kernel, the warning came up as below.

"Do you want to restart the current kernel? All variables will be lost."

What does "all variable will be lost" mean? Will I lose all the things saved at Jupyter notebook? If so, how can I restart the Kernel safely without losing all the things I keep in my Jupyter notebook?

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.

OR,

You can do "Restart & Run All" It will show the message-- Are you sure you want to restart the current kernel and re-execute the whole notebook? All variables and outputs will be lost.

However, after selecting the above option, all the variables and methods will be set again. You don't have to manually execute all the code cells.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM