I created a package called GeometriaPlana at my projects. In the iteractive terminal this dev project run perfectly, but at Jupyter via IJulia, this project throw an error.
ArgumentError: Package GeometriaPlana [d1eaa649-aac2-5819-91da-40fa014b2dd7] is required but does not seem to be installed:
- Run `Pkg.instantiate()` to install all recorded dependencies.
Stacktrace:
[1] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1920
[2] __require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1806
[3] #invoke_in_world#3
@ Base ./essentials.jl:921 [inlined]
[4] invoke_in_world
@ Base ./essentials.jl:918 [inlined]
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1797
[6] macro expansion
@ Base ./loading.jl:1784 [inlined]
[7] macro expansion
@ Base ./lock.jl:267 [inlined]
[8] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:1747
[9] #invoke_in_world#3
@ Base ./essentials.jl:921 [inlined]
[10] invoke_in_world
@ Base ./essentials.jl:918 [inlined]
[11] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1740
This problem happen when I do the command using GeometriaPlana at Julia version 1.10.0 only via Jupyter Notebook.
At the terminal, all works perfectly:
(@v1.10) pkg> status
Status `~/.julia/environments/v1.10/Project.toml`
[d1eaa649] GeometriaPlana v0.0.9 `../../../git/julia/geometriaplana`
[7073ff75] IJulia v1.24.2
[ed5c6046] Matematica v0.1.4 `../../../git/julia/matematica`
(@v1.10) pkg> resolve
No Changes to `~/.julia/environments/v1.10/Project.toml`
No Changes to `~/.julia/environments/v1.10/Manifest.toml`
(@v1.10) pkg> build
Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/51cab8e982c5b598eea9c8ceaced4b58d9dd37c9/build.log`
Building IJulia → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/47ac8cc196b81001a711f4b2c12c97372338f00c/build.log`
julia> using GeometriaPlana
But the problem still persists at Jupyter Notebook.
Do someone knows this problem? I noticed this problem at others dev projects too, this is only a example.
Possibly you are running your notebook in a different environment. You can install a different IJulia kernel with a --project=/some/path argument to use a specified environment.
(@v1.10) pkg> add IJulia
Resolving package versions...
No Changes to `~/.julia/environments/v1.10/Project.toml`
No Changes to `~/.julia/environments/v1.10/Manifest.toml`
(@v1.10) pkg> build
Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/51cab8e982c5b598eea9c8ceaced4b58d9dd37c9/build.log`
Building IJulia → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/47ac8cc196b81001a711f4b2c12c97372338f00c/build.log`
And I runned Jupyter with:
$ jupyter notebook
So I think I’m running at default enviroment (not virtual env.).
Now, I noted that if I copy the notebook to another folder, the code runs, but why?
The default Jupyter kernel that is installed by IJulia starts with the Julia command line flag --project=@.. A Project.toml (or JuliaProject.toml) in the folder of a notebook (or in a parent folder of this notebook) will therefore automatically become the active project for that notebook. Users that don’t want this behavior should install an additional IJulia kernel without that command line flag (see section Installing additional Julia kernels).