4

I'm developing a package in Julia, and I'm using Jupyter Notebook to do some testing. The problem is, every time I make a change to my package, I need to restart the kernel.

I heard that the package Revise.jl is supposed to solve this type of problem, but even after sniffing through the documentation, I didn't quite understand how to properly use it with Jupyter Notebook.

How does one properly avoid restarting the kernel for Jupyter every time one makes a change to the package?

Just to give some more context. I have a folder with the following structure:

Manifest.toml
Project.toml
Readme.md
./examples/Notebook.ipynb
./src/function.jl
./src/MyPackage.jl
1
  • 1
    Doesn't it just work if you run using Revise in the first cell of your notebook, before using MyPackage? When you modify some source file and re-run a cell in your notebook, doesn't it automatically pick the change? (I just checked it works for includet, but was too lazy to check for full-fledged packages) Commented Nov 8, 2020 at 23:21

1 Answer 1

4

I figured out what was going on.

So indeed, one just need to use the Revise.jl package. The reason it wasn’t working for me is that I was importing MyPackage before Revise, and you need to import Revise first. Hence, once I restarted the Kernel and used Revise before MyPackage, things worked flawlessly.

1

Not the answer you're looking for? Browse other questions tagged or ask your own question.