0

I want to import and use functions, structs, and modules from my local julia project under active development named MyProject.jl.

If I cd to my project directory, then activate the project, then call jupyter notebook and run:

include("../src/MyProject.jl")
using .MyProject

I can use the project objects normally. But if I make a change to the project files the change is not reflected in jupyter. It seems to require a kernel restart. Is there any way around this?

BAR
  • 15,909
  • 27
  • 97
  • 185

1 Answers1

2

Assuming you are using Revise.jl, and you have a Project.toml file (i.e. an environment dedicated to your project created using Pkg.activate or PkgTemplates) in your project root directory (MyProject in your example), then you only need to activate the project environment instead of including source files explicitly.

import Pkg
Pkg.activate("../")
using MyProject

Revise will then track the changes that you make to your project source files in MyProject/src/.

loonatick
  • 648
  • 1
  • 7
  • 15