# Using Package in startup.jl causes build problems

**URL:** <https://discourse.julialang.org/t/using-package-in-startup-jl-causes-build-problems/15721>\
**Category:** General Usage\
**Tags:** pkg, package-manager\
**Created:** [October 1, 2018, 5:03am UTC](https://discourse.julialang.org/t/using-package-in-startup-jl-causes-build-problems/15721 "2018-10-01T05:03:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [October 1, 2018, 5:03am UTC](https://discourse.julialang.org/t/using-package-in-startup-jl-causes-build-problems/15721/1 "2018-10-01T05:03:15Z")

</div>

I have a bunch of `using` statements in my `startup.jl`. It seems this is causing problems when other packages are building. An example below. If I remove `using Plots` from startup.jl`the problem goes away. I remember having this same problem a long time ago where`.juliarc.jl` was loaded when the package manager was updating things, but it was solved. Is this intended or known behavor?

```julia
 Building WebIO → `~/.julia/packages/WebIO/myl19/deps/build.log`
┌ Error: Error building `WebIO`: 
│ ERROR: LoadError: ArgumentError: Package Plots not found in current path:
│ - Run `Pkg.add("Plots")` to install the Plots package.
│ 
│ Stacktrace:
│ [1] require(::Module, ::Symbol) at ./loading.jl:817
│ [2] include at ./boot.jl:317 [inlined]
│ [3] include_relative(::Module, ::String) at ./loading.jl:1038
│ [4] include at ./sysimg.jl:29 [inlined]
│ [5] include_ifexists at ./client.jl:201 [inlined]
│ [6] load_julia_startup() at ./client.jl:298
│ [7] exec_options(::Base.JLOptions) at ./logging.jl:312
│ [8] _start() at ./client.jl:432
│ in expression starting at /local/home/fredrikb/.julia/config/startup.jl:5
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:1068
  Building Blink → `~/.julia/packages/Blink/vKGzM/deps/build.log`
┌ Error: Error building `Blink`: 
│ ERROR: LoadError: ArgumentError: Package Plots not found in current path:
│ - Run `Pkg.add("Plots")` to install the Plots package.
│ 
│ Stacktrace:
│ [1] require(::Module, ::Symbol) at ./loading.jl:817
│ [2] include at ./boot.jl:317 [inlined]
│ [3] include_relative(::Module, ::String) at ./loading.jl:1038
│ [4] include at ./sysimg.jl:29 [inlined]
│ [5] include_ifexists at ./client.jl:201 [inlined]
│ [6] load_julia_startup() at ./client.jl:298
│ [7] exec_options(::Base.JLOptions) at ./logging.jl:312
│ [8] _start() at ./client.jl:432
│ in expression starting at /local/home/fredrikb/.julia/config/startup.jl:5
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:1068

```

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [October 1, 2018, 5:12am UTC](https://discourse.julialang.org/t/using-package-in-startup-jl-causes-build-problems/15721/2 "2018-10-01T05:12:50Z")

</div>

Make your startup.jl look like this:

```julia
try
    @eval using Plots
catch err
    nothing
end

```

Or, instead of nothing, you could have it emit a warning.

Taken from here:  
[https://github.com/KristofferC/OhMyREPL.jl/issues/68](https://github.com/KristofferC/OhMyREPL.jl/issues/68)

---

<div class="post-metadata">

**Author:** ![swt30](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/swt30/32/4667_2.png) [@swt30](https://discourse.julialang.org/u/swt30)\
**Post date:** [October 2, 2018, 8:05am UTC](https://discourse.julialang.org/t/using-package-in-startup-jl-causes-build-problems/15721/3 "2018-10-02T08:05:39Z")

</div>

This is [fixed in julia 1.0.1](https://github.com/JuliaLang/julia/pull/29364).
