1

I have modified a function in a file in Spyder (and save it). Now, I rerun a cell that calls that function on my Jupyter Notebook and the modification that I made on my Spyder file does not seem to have effects on my Notebook, still mentioning an error that I had previously.

The only solution I have found to avoid this is to close the Notebook (by ctrl+C and deactivating command on Anaconda prompt and rerun the Notebook).

Of course, it's not so convenient... Is it possible to make it more efficiently ?

Reblochon Masque
  • 35,405
  • 10
  • 55
  • 80
MysteryGuy
  • 1,091
  • 2
  • 18
  • 43

1 Answers1

0

You can restart the kernel in jupyter instead of exiting and relaunching the app.

Then you need to re-execute the cells with the import statements. (use restart and clear output)

enter image description here

There is also a jupyter magic function to reload modules documented here:

%load_ext autoreload
%autoreload 2
Reblochon Masque
  • 35,405
  • 10
  • 55
  • 80