# Why does a user have to run Pkg.init() on the first run?

**URL:** https://discourse.julialang.org/t/why-does-a-user-have-to-run-pkg-init-on-the-first-run/8322
**Category:** New to Julia
**Created:** [January 12, 2018, 4:35pm UTC](https://discourse.julialang.org/t/why-does-a-user-have-to-run-pkg-init-on-the-first-run/8322 "2018-01-12T16:35:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jonjilla](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jonjilla](https://discourse.julialang.org/u/jonjilla)
#### Post date: [January 12, 2018, 4:35pm UTC](https://discourse.julialang.org/t/why-does-a-user-have-to-run-pkg-init-on-the-first-run/8322/1 "2018-01-12T16:35:53Z")

</div>

Newbie question here, but on the first run of Pkg.add on a fresh install of julia, the system errors out with a message that a user needs to run Pkg.init()

ERROR: Package metadata directory julia/PKG/v0.6/METADATA doesn’t exist; run Pkg.init() to initialize it.

It seems to know that it is missing and needs to be run. Why doesn’t the system just run it? Is there some risk for the system to run that automatically in this case?

---

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [January 13, 2018, 6:07am UTC](https://discourse.julialang.org/t/why-does-a-user-have-to-run-pkg-init-on-the-first-run/8322/2 "2018-01-13T06:07:47Z")

</div>

on what platform? it works for me. i am thinking it might be a bug?

one possibility is that you installed Julia pro but try to run it on VSCode? So Julia pro by default install the packages to a different folder.

just maybe. i dont have a pc atm so speculating

---

<div class="post-metadata">

### Author: ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)
#### Post date: [January 13, 2018, 7:50am UTC](https://discourse.julialang.org/t/why-does-a-user-have-to-run-pkg-init-on-the-first-run/8322/3 "2018-01-13T07:50:30Z")

</div>

I remember seeing that too (both mac and linux) and I thought that’s by design…

---

<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 13, 2018, 8:21am UTC](https://discourse.julialang.org/t/why-does-a-user-have-to-run-pkg-init-on-the-first-run/8322/4 "2018-01-13T08:21:49Z")

</div>

Since you can redefine [`JULIA_PKGDIR`](https://docs.julialang.org/en/release-0.6/manual/environment-variables/#JULIA_PKGDIR-1), the package manager cannot be sure that you have an ininitialized repo directory, instead of an initialized one full of packages somewhere else that you just forgot to mention.

---

<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 13, 2018, 8:57am UTC](https://discourse.julialang.org/t/why-does-a-user-have-to-run-pkg-init-on-the-first-run/8322/5 "2018-01-13T08:57:58Z")

</div>

Pkg3 initializes by default on the first action.
