# An error occurred while building the environment

**URL:** <https://discourse.julialang.org/t/an-error-occurred-while-building-the-environment/126053>\
**Category:** New to Julia\
**Tags:** package\
**Created:** [February 19, 2025, 2:44am UTC](https://discourse.julialang.org/t/an-error-occurred-while-building-the-environment/126053 "2025-02-19T02:44:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spurs15437](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/spurs15437/32/215319_2.png) [@Spurs15437](https://discourse.julialang.org/u/Spurs15437)\
**Post date:** [February 19, 2025, 2:44am UTC](https://discourse.julialang.org/t/an-error-occurred-while-building-the-environment/126053/1 "2025-02-19T02:44:45Z")

</div>

```julia
(jl_79BdVv) pkg> precompile
Precompiling project...
  ✗ NCDatasets
  ✗ DIVAnd
  0 dependencies successfully precompiled in 5 seconds. 199 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

DIVAnd

Failed to precompile DIVAnd [efc8151c-67de-5a8f-9a35-d8f54746ae9d] to "C:\\Users\\AS\\.julia\\compiled\\v1.11\\DIVAnd\\jl_C78E.tmp".
ERROR: LoadError: InitError: could not load library "C:\Users\AS\.julia\artifacts\a0f65aec92810567654b7ca3b29b0786088806a6\bin\libnetcdf-19.dll"
The specified module could not be found.
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl .\libdl.jl:120
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl .\libdl.jl:119
  [3] macro expansion
    @ C:\Users\AS\.julia\packages\JLLWrappers\GfYNv\src\products\library_generators.jl:63 [inlined]
  [4] __init__ ()
    @ NetCDF_jll C:\Users\AS\.julia\packages\NetCDF_jll\ZPOuQ\src\wrappers\x86_64-w64-mingw32-mpi+microsoftmpi.jl:23
  [5] run_module_init(mod::Module, i::Int64)
    @ Base .\loading.jl:1378
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1366
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any}, ignore_native::Nothing; register::Bool)
    @ Base .\loading.jl:1254
  [8] _include_from_serialized (repeats 2 times)
    @ .\loading.jl:1210 [inlined]
  [9] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{String, Int64}, DEPOT_PATH::Vector{String})
    @ Base .\loading.jl:2057
 [10] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:2527
 [11] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2388
 [12] #invoke_in_world#3
    @ .\essentials.jl:1089 [inlined]
 [13] invoke_in_world
    @ .\essentials.jl:1086 [inlined]
 [14] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2375
 [15] macro expansion
    @ .\loading.jl:2314 [inlined]
 [16] macro expansion
    @ .\lock.jl:273 [inlined]
 [17] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2271
 [18] #invoke_in_world#3
    @ .\essentials.jl:1089 [inlined]
 [19] invoke_in_world
    @ .\essentials.jl:1086 [inlined]
 [20] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2260
 [21] include
    @ .\Base.jl:557 [inlined]
 [22] 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, UInt128}}, source::String)
    @ Base .\loading.jl:2881
 [23] top-level scope
    @ stdin:6
during initialization of module NetCDF_jll
in expression starting at C:\Users\AS\.julia\packages\NCDatasets\LjXBn\src\NCDatasets.jl:1
in expression starting at stdin:6
ERROR: LoadError: Failed to precompile NCDatasets [85f8d34a-cbdd-5861-8df4-14fed0d494ab] to "C:\\Users\\AS\\.julia\\compiled\\v1.11\\NCDatasets\\jl_C9F5.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; flags::Cmd, cacheflags::Base.CacheFlags, reasons::Dict{String, Int64}, loadable_exts::Nothing)
    @ Base .\loading.jl:3174
  [3] (::Base.var"#1110#1111"{Base.PkgId})()
    @ Base .\loading.jl:2579
  [4] mkpidlock(f::Base.var"#1110#1111"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile C:\Users\AS\AppData\Local\Programs\Julia-1.11.3\share\julia\stdlib\v1.11\FileWatching\src\pidfile.jl:95
  [5] #mkpidlock#6
    @ C:\Users\AS\AppData\Local\Programs\Julia-1.11.3\share\julia\stdlib\v1.11\FileWatching\src\pidfile.jl:90 [inlined]
  [6] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile C:\Users\AS\AppData\Local\Programs\Julia-1.11.3\share\julia\stdlib\v1.11\FileWatching\src\pidfile.jl:116
  [7] #invokelatest#2
    @ .\essentials.jl:1057 [inlined]
  [8] invokelatest
    @ .\essentials.jl:1052 [inlined]
  [9] maybe_cachefile_lock(f::Base.var"#1110#1111"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base .\loading.jl:3698
 [10] maybe_cachefile_lock
    @ .\loading.jl:3695 [inlined]
 [11] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:2565
 [12] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2388
 [13] #invoke_in_world#3
    @ .\essentials.jl:1089 [inlined]
 [14] invoke_in_world
    @ .\essentials.jl:1086 [inlined]
 [15] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2375
 [16] macro expansion
    @ .\loading.jl:2314 [inlined]
 [17] macro expansion
    @ .\lock.jl:273 [inlined]
 [18] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2271
 [19] #invoke_in_world#3
    @ .\essentials.jl:1089 [inlined]
 [20] invoke_in_world
    @ .\essentials.jl:1086 [inlined]
 [21] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2260
 [22] include
    @ .\Base.jl:557 [inlined]
 [23] 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, UInt128}}, source::Nothing)
    @ Base .\loading.jl:2881
 [24] top-level scope
    @ stdin:6
in expression starting at C:\Users\AS\.julia\packages\DIVAnd\4UymR\src\DIVAnd.jl:1
in expression starting at stdin:

```

I wish I had some big guy to point me in the right direction

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [February 19, 2025, 9:08am UTC](https://discourse.julialang.org/t/an-error-occurred-while-building-the-environment/126053/2 "2025-02-19T09:08:19Z")

</div>

> [@HDF5 is broken on Windows?](https://discourse.julialang.org/t/hdf5-is-broken-on-windows/125988):
>
> Since yesterday I started to see failures in building GMT in CI (and locally) due to ERROR: LoadError: InitError: could not load library "C:\Users\j\.julia\artifacts\a0f65aec92810567654b7ca3b29b0786088806a6\bin\libnetcdf-19.dll" libnetcdf did not cahnge recently but HDF5 did change yesterday [HDF5\_jll build 1.14.5+0 · JuliaBinaryWrappers/HDF5\_jll.jl@3f7b3cd · GitHub](https://github.com/JuliaBinaryWrappers/HDF5_jll.jl/commit/3f7b3cd85e9bd796307d709961bcf2c8b626dde1)
