# How to find out if precompilation during Pkg.add was successful?

**URL:** <https://discourse.julialang.org/t/how-to-find-out-if-precompilation-during-pkg-add-was-successful/116104>\
**Category:** General Usage\
**Tags:** pkg, precompilation\
**Created:** [June 22, 2024, 7:45pm UTC](https://discourse.julialang.org/t/how-to-find-out-if-precompilation-during-pkg-add-was-successful/116104 "2024-06-22T19:45:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthias314](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Post date:** [June 22, 2024, 7:45pm UTC](https://discourse.julialang.org/t/how-to-find-out-if-precompilation-during-pkg-add-was-successful/116104/1 "2024-06-22T19:45:39Z")

</div>

Assume some Julia code adds a package `pkg` via `Pkg.add(pkg)`. How can subsequent code determine if the package precompiled successfully?

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [June 22, 2024, 7:55pm UTC](https://discourse.julialang.org/t/how-to-find-out-if-precompilation-during-pkg-add-was-successful/116104/2 "2024-06-22T19:55:54Z")

</div>

If precompilation did not succeed, then there will be an error when trying to use `import` or `using`.

---

<div class="post-metadata">

**Author:** ![matthias314](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Post date:** [June 22, 2024, 9:38pm UTC](https://discourse.julialang.org/t/how-to-find-out-if-precompilation-during-pkg-add-was-successful/116104/3 "2024-06-22T21:38:56Z")

</div>

Well, is there a way without using `import` or `using` (without restarting Julia)? The problem is that you cannot undo such a command. For example, the following leads to an error:

```julia
using Pkg
Pkg.activate(; temp = true)
Pkg.add("AxisKeys")
import AxisKeys
Pkg.activate(; temp = true)
Pkg.add("FFTViews")
import FFTViews

```

It gives

```julia
┌ Error: Error during loading of extension AbstractFFTsExt of NamedDims, use `Base.retry_load_extensions()` to retry.
│ exception =
│ 1-element ExceptionStack:
│ ArgumentError: Package AbstractFFTsExt [ec604236-bdd8-5045-8fae-50e3b7893c8a] is required but does not seem to be installed:
│ - Run `Pkg.instantiate()` to install all recorded dependencies.
[...]
└ @ Base loading.jl:1301
┌ Error: Error during loading of extension AbstractFFTsExt of AxisKeys, use `Base.retry_load_extensions()` to retry.
│ exception =
│ 1-element ExceptionStack:
│ ArgumentError: Package AbstractFFTsExt [7cd4eef3-a486-5c57-b280-f5e9e842d192] is required but does not seem to be installed:
│ - Run `Pkg.instantiate()` to install all recorded dependencies.

```

Without the first `import` it works fine.
