iTranslated by AI
How to Use Revise.jl on Jupyter Notebook
Julia Advent Calendar 2025 Day 2 🎄
Introduction
This article explains how to use Revise.jl, which reflects code updates in real time when developing packages in Julia, on Jupyter Notebook.
Usage
Although the documentation assumes usage on the REPL,
pkg> dev Example
can be replaced with
import Pkg; Pkg.develop(url="./Example.jl")
so that it can be used not only on the REPL but also on Jupyter Notebook. The key points are that the dev command in package mode corresponds to Pkg.develop, and that you specify the file path using the keyword argument url="./Example.jl".
Example
I have prepared a working code example, so please try it. First, clone the GitHub repository in your terminal and move into it.
git clone https://github.com/ohno/hello-revise.git
cd hello-revise
Then run the following code in the Julia REPL or Jupyter Notebook in that directory.
using Revise
import Pkg; Pkg.develop(url="./Hello.jl")
using Hello
Hello.hello()
If you modify the source code of Hello.hello(), you can confirm that the behavior changes accordingly. If it doesn't work well, check the directory with pwd() and change it with cd().
References
Discussion