# DataFrames precompilation failure

**URL:** <https://discourse.julialang.org/t/dataframes-precompilation-failure/106163>\
**Category:** General Usage\
**Tags:** precompilation, dataframes\
**Created:** [November 13, 2023, 10:08pm UTC](https://discourse.julialang.org/t/dataframes-precompilation-failure/106163 "2023-11-13T22:08:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![albrightand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albrightand/32/38684_2.png) [@albrightand](https://discourse.julialang.org/u/albrightand)\
**Post date:** [November 13, 2023, 10:08pm UTC](https://discourse.julialang.org/t/dataframes-precompilation-failure/106163/1 "2023-11-13T22:08:16Z")

</div>

Today I can’t get DataFrames.jl to pre-compile – even though I have had no issue previously. Any advice is welcome on how to fix the pre-compilation.

I tried to make a whole new project with only DataFrames, so there would be no issue with compatibility with other packages. Here are the errors from Pkg.precompile():

```julia

julia> Pkg.precompile()
Precompiling environment...
  ✗ SortingAlgorithms
  ✗ DataFrames
  0 dependencies successfully precompiled in 5 seconds. 27 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

DataFrames [a93c6f00-e57d-5684-b7b6-d8193f3e46c0]

Failed to precompile DataFrames [a93c6f00-e57d-5684-b7b6-d8193f3e46c0] to C:\Users\Andrea.Albright\.julia\compiled\v1.9\DataFrames\jl_3939.tmp.
ERROR: LoadError: UndefVarError: `@getkw` not defined
Stacktrace:
 [1] include
   @ .\Base.jl:450 [inlined]
 [2] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base .\loading.jl:1667
 [3] top-level scope
   @ stdin:1
in expression starting at C:\Users\Andrea.Albright\.julia\packages\SortingAlgorithms\3sO8j\src\SortingAlgorithms.jl:124
in expression starting at C:\Users\Andrea.Albright\.julia\packages\SortingAlgorithms\3sO8j\src\SortingAlgorithms.jl:3
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile SortingAlgorithms [a2af1166-a08f-5f64-846c-94a0d3cef48c] to C:\Users\Andrea.Albright\.julia\compiled\v1.9\SortingAlgorithms\jl_3A1E.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base .\loading.jl:1820
  [3] compilecache
    @ .\loading.jl:1764 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1431
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1295
  [6] macro expansion
    @ .\loading.jl:1275 [inlined]
  [7] macro expansion
    @ .\lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1238
  [9] include
    @ .\Base.jl:450 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base .\loading.jl:1667
 [11] top-level scope
    @ stdin:1
in expression starting at C:\Users\Andrea.Albright\.julia\packages\DataFrames\58MUJ\src\DataFrames.jl:1  
in expression starting at stdin:1
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types C:\Users\Andrea.Albright\AppData\Local\Programs\Julia-1.9.0-alpha1\share\julia\stdlib\v1.9\Pkg\src\Types.jl:68
 [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{String}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API C:\Users\Andrea.Albright\AppData\Local\Programs\Julia-1.9.0-alpha1\share\julia\stdlib\v1.9\Pkg\src\API.jl:1436
 [3] precompile
   @ C:\Users\Andrea.Albright\AppData\Local\Programs\Julia-1.9.0-alpha1\share\julia\stdlib\v1.9\Pkg\src\API.jl:1073 [inlined]
 [4] #precompile#217
   @ C:\Users\Andrea.Albright\AppData\Local\Programs\Julia-1.9.0-alpha1\share\julia\stdlib\v1.9\Pkg\src\API.jl:1072 [inlined]
 [5] precompile
   @ C:\Users\Andrea.Albright\AppData\Local\Programs\Julia-1.9.0-alpha1\share\julia\stdlib\v1.9\Pkg\src\API.jl:1072 [inlined]
 [6] precompile()
   @ Pkg.API C:\Users\Andrea.Albright\AppData\Local\Programs\Julia-1.9.0-alpha1\share\julia\stdlib\v1.9\Pkg\src\API.jl:1072
 [7] top-level scope
   @ REPL[7]:1

```

Running Julia v1.9.0-alpha1 on a Windows 10 machine.

Never had a issue with DataFrames until today.

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [November 13, 2023, 10:27pm UTC](https://discourse.julialang.org/t/dataframes-precompilation-failure/106163/2 "2023-11-13T22:27:15Z")

</div>

What version of DataFrames is being installed?

---

<div class="post-metadata">

**Author:** ![albrightand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albrightand/32/38684_2.png) [@albrightand](https://discourse.julialang.org/u/albrightand)\
**Post date:** [November 13, 2023, 10:31pm UTC](https://discourse.julialang.org/t/dataframes-precompilation-failure/106163/3 "2023-11-13T22:31:30Z")

</div>

The most recent one: DataFrames v1.6.1

---

<div class="post-metadata">

**Author:** ![palday](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palday/32/12640_2.png) [@palday](https://discourse.julialang.org/u/palday)\
**Post date:** [November 13, 2023, 10:34pm UTC](https://discourse.julialang.org/t/dataframes-precompilation-failure/106163/4 "2023-11-13T22:34:35Z")

</div>

> [@albrightand](#):
>
> Running Julia v1.9.0-alpha1 on a Windows 10 machine.

Why not Julia v1.9.3?

---

<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:** [November 14, 2023, 2:57am UTC](https://discourse.julialang.org/t/dataframes-precompilation-failure/106163/5 "2023-11-14T02:57:49Z")

</div>

> [@albrightand](#):
>
> ` `@getkw``

Upgrading to Julia 1.9.3 would fix the issue.

> <https://github.com/JuliaCollections/SortingAlgorithms.jl/blob/main/src/SortingAlgorithms.jl#L111>

I recommend using `juliaup`.

> **[GitHub - JuliaLang/juliaup: Julia installer and version multiplexer](https://github.com/JuliaLang/juliaup)**
>
> Julia installer and version multiplexer. Contribute to JuliaLang/juliaup development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [November 14, 2023, 9:06am UTC](https://discourse.julialang.org/t/dataframes-precompilation-failure/106163/6 "2023-11-14T09:06:24Z")

</div>

Looks like a bug in SortingAlgorithms.jl right?

---

<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:** [November 14, 2023, 1:26pm UTC](https://discourse.julialang.org/t/dataframes-precompilation-failure/106163/7 "2023-11-14T13:26:53Z")

</div>

The `if` statement is probably wrong in that the lower bound should be higher or non-inclusive. I am far more worried that the OP is using an alpha version that is known to be defective.

---

<div class="post-metadata">

**Author:** ![albrightand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albrightand/32/38684_2.png) [@albrightand](https://discourse.julialang.org/u/albrightand)\
**Post date:** [November 14, 2023, 4:36pm UTC](https://discourse.julialang.org/t/dataframes-precompilation-failure/106163/8 "2023-11-14T16:36:44Z")

</div>

Thank all for the quick responses. Updating to Julia v1.9.3 fixed the issue.
