-
-
Notifications
You must be signed in to change notification settings - Fork 285
Open
Description
Sometimes it is useful to create a new environment stacked on the current environment
(where the current environment is not the "base" v1.x environment)
e.g. Have both "Level1" and "Level2" packages available by doing something like this
(v1.1) pkg> activate Level1
[ Info: activating new environment at ~/Level1.
(Level1) pkg> add Example
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
Resolving package versions...
Updating `~/Level1/Project.toml`
[7876af07] + Example v0.5.1
Updating `~/Level1/Manifest.toml`
[7876af07] + Example v0.5.1
...
(Level1) pkg> activate Level2
[ Info: activating new environment at ~/Level2.
julia> using Example
ERROR: ArgumentError: Package Example not found in current path:
- Run `import Pkg; Pkg.add("Example")` to install the Example package.
Stacktrace:
[1] require(::Module, ::Symbol) at ./loading.jl:823
julia> LOAD_PATH
3-element Array{String,1}:
"@"
"@v#.#"
"@stdlib"^ This doesn't stack Level2 on Level1
The workaround is to pushfirst!(LOAD_PATH, "path/to/Level1") (Thanks @fredrikekre for pointing this out).
e.g.
julia> pushfirst!(Base.LOAD_PATH, "/Users/nick/Level1")
6-element Array{String,1}:
"/Users/nick/Level1"
"@"
"@v#.#"
"@stdlib"
(Level2) pkg> status
Status `~/Level2/Project.toml`
(empty environment)
julia> using Example
[ Info: Precompiling Example [7876af07-990d-54b4-ab0e-23690620f79a]Perhaps this can be an argument to activate? e.g. activate --stack Level2, to first add the current environment to the LOAD_PATH before activating the new one?
Metadata
Metadata
Assignees
Labels
No labels