# Creating Packages tutorial: Precompile error

**URL:** <https://discourse.julialang.org/t/creating-packages-tutorial-precompile-error/134934>\
**Category:** General Usage\
**Created:** [January 7, 2026, 1:55pm UTC](https://discourse.julialang.org/t/creating-packages-tutorial-precompile-error/134934 "2026-01-07T13:55:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nbrantut](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nbrantut/32/51836_2.png) [@nbrantut](https://discourse.julialang.org/u/nbrantut)\
**Post date:** [January 7, 2026, 1:55pm UTC](https://discourse.julialang.org/t/creating-packages-tutorial-precompile-error/134934/1 "2026-01-07T13:55:41Z")

</div>

I am trying to make a new package, using Julia v1.10 on macosx. Coming back to basics and following the tutorial ( [5. Creating Packages · Pkg.jl](https://pkgdocs.julialang.org/v1/creating-packages/) ), I am running into a precompilation error. (This happens for all external dependencies, whether using `using` or `import`).

Steps I followed:

1. Open new julia session, go to package mode with `]` and then:  
`generate HelloWorld`
2. Exit, move to new `HelloWorld` directory, then `]` and  
`activate .`  
`add Random, JSON`
3. Edit `src/HelloWorld.jl` to add lines:  
`import Random`  
`import JSON`
4. Try `import HelloWorld` or `] instantiate` produces the error:

```julia-auto
PkgPrecompileError: The following 1 direct dependency failed to precompile:

HelloWorld 

Failed to precompile HelloWorld [a7910909-222d-43b5-af01-f98d6d1097cc] to "/Users/me/.julia/compiled/v1.10/HelloWorld/jl_8N6nzx".
ERROR: LoadError: ArgumentError: Package JSON [682c06a0-de6a-54ab-a142-c8b1cf79cde6] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

Stacktrace:
  [1] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1996
  [2] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1882
  [3] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
  [4] invoke_in_world
    @ ./essentials.jl:923 [inlined]
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1873
  [6] macro expansion
    @ ./loading.jl:1860 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1823
  [9] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [10] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [11] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1816
 [12] include
    @ ./Base.jl:495 [inlined]
 [13] 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:2292
 [14] top-level scope
    @ stdin:4
in expression starting at .../HelloWorld/src/HelloWorld.jl:1
in expression starting at stdin:

```

Am I doing something stupid?  
Note: my standard environment is clean (nothing added to v1.10)

---

<div class="post-metadata">

**Author:** ![nbrantut](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nbrantut/32/51836_2.png) [@nbrantut](https://discourse.julialang.org/u/nbrantut)\
**Post date:** [February 14, 2026, 6:34pm UTC](https://discourse.julialang.org/t/creating-packages-tutorial-precompile-error/134934/2 "2026-02-14T18:34:48Z")

</div>

I found what the problem was: I was trying to develop the package in a folder that was on my JULIA\_LOAD\_PATH. After removing that folder for the path, everything worked fine.

I am not sure why this happens and if this is intentional. Eventually I will have to put the folder back on the Julia load path, if I want to use it (as a locally stored package). Or is it made so that packages can only be updated locally using dev?

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [February 14, 2026, 8:00pm UTC](https://discourse.julialang.org/t/creating-packages-tutorial-precompile-error/134934/3 "2026-02-14T20:00:02Z")

</div>

Yes, you don’t need packages to be in `JULIA_LOAD_PATH` to use them. You can use `dev` in the pkg repl with the path to the local package to add that package to an environment.

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [February 14, 2026, 8:28pm UTC](https://discourse.julialang.org/t/creating-packages-tutorial-precompile-error/134934/4 "2026-02-14T20:28:47Z")

</div>

Messing with `JULIA_LOAD_PATH` is discouraged by now, now it’s `dev` in `Revise`-d development and `add` from registries otherwise (registries provide the information needed for versioned dependency resolution), though activating a package’s environment directly is enough for precompilation, import, and less convenient development. But I am curious why `JULIA_LOAD_PATH` causes this failure.
