Davi Barreira
Davi Barreira

Reputation: 1681

Julia - Developing package and updating changes without restarting Jupyter Notebook kernel

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

Upvotes: 5

Views: 593

Answers (1)

Davi Barreira
Davi Barreira

Reputation: 1681

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.

Upvotes: 5

Related Questions