# Importing an existing package without re-precompiling

**URL:** https://discourse.julialang.org/t/importing-an-existing-package-without-re-precompiling/94248
**Category:** New to Julia
**Tags:** package, precompilation
**Created:** [February 8, 2023, 2:04am UTC](https://discourse.julialang.org/t/importing-an-existing-package-without-re-precompiling/94248 "2023-02-08T02:04:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![RomeoV](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/romeov/32/37687_2.png) [@RomeoV](https://discourse.julialang.org/u/RomeoV)
#### Post date: [February 8, 2023, 2:04am UTC](https://discourse.julialang.org/t/importing-an-existing-package-without-re-precompiling/94248/1 "2023-02-08T02:04:15Z")

</div>

Often, I need functionality of a low-level package, say ChainRulesCore.jl, which is already included by other packages and thus in the Manifest.toml, but not yet in the Project.toml.  
Therefore I `]add ChainRulesCore`, however this triggers a re-precompile of many of my existing packages, which takes minutes and completely breaks my workflow. This is especially annoying if it happens for multiple packages in a row. Is there are way to “add” an already installed package without triggering a mass re-precompile? I already looked at the `]add --preserve` flag, however none of the options seemed to help…

---

<div class="post-metadata">

### Author: ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)
#### Post date: [February 8, 2023, 2:24am UTC](https://discourse.julialang.org/t/importing-an-existing-package-without-re-precompiling/94248/2 "2023-02-08T02:24:44Z")

</div>

You can do `using Package.Dependency`, e.g.

```julia
julia> using StaticArrays

julia> using StaticArrays.StaticArraysCore

julia> StaticArraysCore.Size(rand(3,3))
Size(StaticArraysCore.Dynamic(), StaticArraysCore.Dynamic())

```

This is **not safe** , since package dependencies are internal to the package and can be removed completely without counting as a breaking change (unless they’re part of the package’s documented API). But if you’re just going for something quick and dirty, it’ll do.

---

<div class="post-metadata">

### Author: ![RomeoV](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/romeov/32/37687_2.png) [@RomeoV](https://discourse.julialang.org/u/RomeoV)
#### Post date: [February 8, 2023, 2:28am UTC](https://discourse.julialang.org/t/importing-an-existing-package-without-re-precompiling/94248/3 "2023-02-08T02:28:10Z")

</div>

Thanks! Yes, something quick and dirty will often do during rapid development.  
It is good to have the option, and then fix the dependency once you’re sure that is actually what you need.

---

<div class="post-metadata">

### Author: ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)
#### Post date: [February 8, 2023, 5:34am UTC](https://discourse.julialang.org/t/importing-an-existing-package-without-re-precompiling/94248/4 "2023-02-08T05:34:30Z")

</div>

`Pkg.offline(true)` might also work.
