iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🌱

How to Use Revise.jl on Jupyter Notebook

に公開

Julia Advent Calendar 2025 Day 2 🎄
https://qiita.com/advent-calendar/2025/julia

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

https://timholy.github.io/Revise.jl/stable/

https://github.com/ohno/hello-revise

Discussion