# Adding packages present in custom sysimage into environment when running with that sysimage

**URL:** <https://discourse.julialang.org/t/adding-packages-present-in-custom-sysimage-into-environment-when-running-with-that-sysimage/95107>\
**Category:** General Usage\
**Tags:** pkg, sysimage\
**Created:** [February 23, 2023, 9:54pm UTC](https://discourse.julialang.org/t/adding-packages-present-in-custom-sysimage-into-environment-when-running-with-that-sysimage/95107 "2023-02-23T21:54:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![airpmb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/airpmb/32/7826_2.png) [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Post date:** [February 23, 2023, 9:54pm UTC](https://discourse.julialang.org/t/adding-packages-present-in-custom-sysimage-into-environment-when-running-with-that-sysimage/95107/1 "2023-02-23T21:54:07Z")

</div>

I have a sysimage (which happens to include Makie, GLMakie, CairoMakie and MakieCore) which was built in a (temporary) environment where the Makie packages were included via `]develop --local`. When I start Julia using the sysimage, and activate a temporary environment it doesn’t appear to be possible to either `add` or `dev` the necessary packages so that they can be `using`’d or `import`-ed.

It seems like the 2 sane options would be to:

1. `add` a package from the appropriate branch of the repo (in this case, my fork), but this errors:

```julia
(jl_DnkKkw) pkg> add "git@github.com:pbouffard/Makie.jl.git"#scroll-to-pan
     Cloning git-repo `git@github.com:pbouffard/Makie.jl.git`
    Updating git-repo `git@github.com:pbouffard/Makie.jl.git`
ERROR: Tried to develop or add by URL package Makie [ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a] which is already in the sysimage, use `Pkg.respect_sysimage_versions(false)` to disable this check.

```

or,

1. `dev` the local checkout of Makie, which also errors:

```julia
(jl_oS0vJP) pkg> dev --local /Users/patrick/dev/makiedev/dev/Makie
ERROR: Tried to develop or add by URL package Makie [ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a] which is already in the sysimage, use `Pkg.respect_sysimage_versions(false)` to disable this check.

```

What does seem to work is to start Julia without a sysimage, create a new persistent environment, `]dev --local` the packages into that environment, and then restart Julia with the sysimage.

I guess my question is, is it impossible to tell Pkg to `add` (or `dev`) any packages (modules?) that are included in a custom sysimage, when running with that sysimage itself? Or, is setting `Pkg.respect_sysimage_versions(false)` as the error messages suggests what I want?

More generally, what is the correct workflow for adding packages to an environment, when those packages are included in a sysimage?
