# How to automatically use packages at startup?

**URL:** https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509
**Category:** General Usage
**Created:** [January 21, 2018, 8:10pm UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509 "2018-01-21T20:10:36Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [January 21, 2018, 8:10pm UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/1 "2018-01-21T20:10:36Z")

</div>

Is it possible to have the REPL automatically call `using PackageName` at startup? This seems very useful with 0.7 (`using LinearAlgebra`), etc.

I tried to find it the Julia docs, maybe the answer could be added to the FAQ under “Sessions and the REPL”.

---

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [January 21, 2018, 8:16pm UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/2 "2018-01-21T20:16:57Z")

</div>

There is `~/.juliarc.jl`, which is executed by default for REPL and non-interactive sessions. You can disable it with the option ` --startup-file={yes|no} Load ~/.juliarc.jl`.

It’s mentioned in a few places in the docs (easy to find if you know that it’s juliarc.jl` …), e.g.: [https://docs.julialang.org/en/stable/manual/getting-started/#Getting-Started-1](https://docs.julialang.org/en/stable/manual/getting-started/#Getting-Started-1)

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [January 21, 2018, 8:34pm UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/3 "2018-01-21T20:34:10Z")

</div>

Thanks! (I remembered there was a file, just couldn’t remember the name.)

This should be made very prominent in preparation for 0.7. (which is almost unusable without it, as if you forget `using LinearAlgebra` or `using Random` you have to start the REPL over again.)

---

<div class="post-metadata">

### Author: ![bramtayl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bramtayl/32/3614_2.png) [@bramtayl](https://discourse.julialang.org/u/bramtayl)
#### Post date: [January 22, 2018, 3:16am UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/4 "2018-01-22T03:16:50Z")

</div>

What does rc stand for? juliarc seems like a particularly unmemorable name

---

<div class="post-metadata">

### Author: ![goretkin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goretkin/32/167_2.png) [@goretkin](https://discourse.julialang.org/u/goretkin)
#### Post date: [January 22, 2018, 5:19am UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/5 "2018-01-22T05:19:34Z")

</div>

from [rc file](http://www.catb.org/jargon/html/R/rc-file.html)

> [An rc file is a] Script file containing startup instructions for an application program (or an entire operating system), usually a text file containing commands of the sort that might have been invoked manually once the system was running but are to be executed automatically each time the system starts up.

Its etymology is obscure (click the link for details), but it’s a unix convention (for example `.bashrc`).

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [January 22, 2018, 7:04am UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/6 "2018-01-22T07:04:54Z")

</div>

I would say it is particularly memorable, looking at other examples:

```julia
.bashrc
.octaverc
.screenrc
.vimrc
.initrc

```

etc.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [January 22, 2018, 7:53am UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/7 "2018-01-22T07:53:34Z")

</div>

> [@dlfivefifty](#):
>
> if you forget using LinearAlgebra or using Random you have to start the REPL over again

I may be missing something, but can’t you just load anything later if you need it? Why do you need to restart the REPL?

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [January 22, 2018, 8:17am UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/8 "2018-01-22T08:17:06Z")

</div>

The namespace gets polluted, so you have to then do `Random.rand` to call `rand`

---

<div class="post-metadata">

### Author: ![bramtayl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bramtayl/32/3614_2.png) [@bramtayl](https://discourse.julialang.org/u/bramtayl)
#### Post date: [January 22, 2018, 8:22am UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/9 "2018-01-22T08:22:17Z")

</div>

More evidence that we need a unix sans abbreviations. Programming should be easier than playing nethack.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [January 22, 2018, 9:15am UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/10 "2018-01-22T09:15:40Z")

</div>

I see, I think this was a blind spot for me given my workflow (doing almost everything in modules, with `Revise.jl`).

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [January 22, 2018, 9:38am UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/11 "2018-01-22T09:38:26Z")

</div>

1.0 won’t be as bad as it’ll just error out with `UndefVarError`. It’s the deprecation message that makes this so painful.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [January 22, 2018, 9:50am UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/12 "2018-01-22T09:50:20Z")

</div>

1. The abbreviation is standard on Unixes. This is the first thing an experienced user would look for.

2. It is very well documented, both in [Getting Started](https://docs.julialang.org/en/latest/manual/getting-started/#Getting-Started-1), and in the command line:

```bash
$ julia --help | grep juliarc
 --startup-file={yes|no} Load ~/.juliarc.jl

```

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [February 28, 2018, 2:46pm UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/13 "2018-02-28T14:46:54Z")

</div>

FYI it’s been moved to `~/.julia/config/startup.jl`

[https://github.com/JuliaLang/julia/issues/26215](https://github.com/JuliaLang/julia/issues/26215)

---

<div class="post-metadata">

### Author: ![1009](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1009/32/12688_2.png) [@1009](https://discourse.julialang.org/u/1009)
#### Post date: [December 31, 2020, 10:06am UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/14 "2020-12-31T10:06:14Z")

</div>

Hi. I’m trying to locate the `startup.jl` file but couldn’t find it. There is no `config` folder in `~/.julia/`. I also try to find `startup.jl` with a fuzzy finder but couldn’t find it. I’m running Julia 1.5. Has this changed in the meantime (with the goal of loading script on startup)? Many thanks in advance

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [December 31, 2020, 10:07am UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/15 "2020-12-31T10:07:10Z")

</div>

If it isn’t there, you can just create it.

---

<div class="post-metadata">

### Author: ![1009](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1009/32/12688_2.png) [@1009](https://discourse.julialang.org/u/1009)
#### Post date: [December 31, 2020, 11:27am UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/16 "2020-12-31T11:27:04Z")

</div>

Many thanks @kristoffer.carlsson ! that worked indeed!

---

<div class="post-metadata">

### Author: ![fph](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fph/32/17159_2.png) [@fph](https://discourse.julialang.org/u/fph)
#### Post date: [December 31, 2020, 4:03pm UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509/17 "2020-12-31T16:03:16Z")

</div>

> [@Tamas\_Papp](#):
>
> The abbreviation is standard on Unixes. This is the first thing an experienced user would look for.

As an experienced Linux user, I wouldn’t bat an eye at `.julia/startup.jl` either. And if I had to look for Julia’s config file I would write `.jul` and type tab anyway.

(And secretly think “I hope this is none of that fancy new stuff that puts config files in `.config`”.)
