Adding academic licensed Pumas/DeepPumas packages to an already existing project?

As per title, is this possible? I have an already created project folder, with its own Project.toml and I’d like to use DeepPumas.jl in it. If, when using VSCode, I select “Install to project” option (instead of the global option) it throws
Failed to initialize DeepPumas@0.8.1
Error: ErrorException(“path c:\\some_project.jl already contains a Project.toml file.”)

here some_project.jl has been set up by DrWatson.jl, so it already has significant amounts of structure in it.

I don’t think there is an easy solution here. We test our releases with a specific combination of packages, so there is not much flexibility. I think you’d have to start from the Project file created by the Pumas extension and then try to add (with –preserve=all) the extra packages of your current environment.

1 Like

Yeah, I can hack around this by first creating a project with DeepPumas and then manually copy pasting the structure created by DrWatson and adding packages on top.

I ran into an issue while using the approach described above. If I install DeepPumas.jl to a folder and try to build a project around it there are some packages that I can’t add to that project, for example Random.jl. If I do ]add Random then I get (same for Serialization.jl)

add Random
Random is pinned at vnothing: maintaining pinned version
Resolving package versions…
ERROR: MethodError: no method matching length(::Nothing)WARNING: both Symbolics and ModelingToolkit export “infimum”; uses of it in module DataDrivenDiffEq must be qualified
WARNING: both Symbolics and ModelingToolkit export “supremum”; uses of it in module DataDrivenDiffEq must be qualified

Closest candidates are:
length(::Base.EnvDict)
@ Base env.jl:224
length(::NamedDims.ColourString)
@ NamedDims C:\Users\domli.julia\packages\NamedDims\JYo6S\src\show.jl:38
length(::HDF5.ASCIIChar)
@ HDF5 C:\Users\domli.julia\packages\HDF5\Z859u\src\typeconversions.jl:8
…
Stacktrace:
[1] union!(s::Set{Any}, itr::Nothing)
@ Base .\abstractset.jl:104
[2] Set{Any}(itr::Nothing)
@ Base .\set.jl:47
[3] _shrink(shrinker!::typeof(intersect!), itr::Nothing, itrs::Tuple{Pkg.Versions.VersionSpec})
@ Base .\array.jl:2855
[4] intersect(itr::Nothing, itrs::Pkg.Versions.VersionSpec)
@ Base .\array.jl:2859
[5] resolve_versions!(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber, installed_only::Bool)
@ Pkg.Operations C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:387
[6] targeted_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
@ Pkg.Operations C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1360
[7] tiered_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber, try_all_installed::Bool)
@ Pkg.Operations C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1332
[8] _resolve(io::Base.TTY, env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
@ Pkg.Operations C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1370
[9] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
@ Pkg.Operations C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1387
[10] add
@ C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1376 [inlined]
[11] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::@Kwargs{io::Base.TTY})
@ Pkg.API C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:278
[12] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{})
@ Pkg.API C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:159
[13] add(pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.API C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:148
[14] do_cmd!(command::Pkg.REPLMode.Command, repl::REPL.LineEditREPL)
@ Pkg.REPLMode C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\REPLMode\REPLMode.jl:412
[15] do_cmd(repl::REPL.LineEditREPL, input::String; do_rethrow::Bool)
@ Pkg.REPLMode C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\REPLMode\REPLMode.jl:390
[16] do_cmd
@ C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\REPLMode\REPLMode.jl:380 [inlined]
[17] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
@ Pkg.REPLMode C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\REPLMode\REPLMode.jl:557
[18] #invokelatest#2
@ .\essentials.jl:892 [inlined]
[19] invokelatest
@ .\essentials.jl:889 [inlined]
[20] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
@ REPL.LineEdit C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\LineEdit.jl:2656
[21] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
@ REPL C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:1312
[22] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
@ REPL C:\Users\domli.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:386

Any suggestions that I could try?

Pkg in Julia 1.10 seems to have trouble with packages that are pinned with no set version (stdlibs). I can’t replicate that behaviour on any of our product versions that use Julia 1.11.

I’d suggest the following steps if you need to add packages that aren’t in deps:

(@DeepPumas@0.8.1) pkg> free --all
...

(@DeepPumas@0.8.1) pkg> add --preserve=all Random
...

(@DeepPumas@0.8.1) pkg> pin --all
...

(@DeepPumas@0.8.1) pkg> st Random
Status `~/.julia/environments/DeepPumas@0.8.1/Project.toml`
  [9a3f8284] Random ⚲

That should allow you to add the packages while keeping the versions of anything installed consistent with what DeepPumas@0.8.1 is tested to work with.

1 Like