IJulia doesn’t automatically use your currently active environment when you launch from the REPL, but the kernel that is activated in the Jupyter notebook session.
See
I have a pull request that updates the docs as:
If an existing Project.toml
file is not found then, by default, an IJulia notebook will try to run a Julia kernel
with its active project set from the global or default environment (usually of the form ~/.julia/environments/v1.x
).
If the IJulia package is not installed in that environment, then the Julia kernel selected by default will not be able to
connect, and a Connection failed error will be displayed. In this case, users should install a additional
Julia kernel that uses their chosen Julia environment.
For example, if the desired environment is currently activated in the REPL then one possibility is to execute
IJulia.installkernel("Julia MyProjectEnv", "--project=$(Base.active_project())")
and subsequently select the kernel starting with Julia MyProjectEnv
from Kernel > Change Kernel in the menu of the Jupyter notebook.