# Adding package issue with Julia and VS Code

**URL:** https://discourse.julialang.org/t/adding-package-issue-with-julia-and-vs-code/62302
**Category:** Package Management
**Created:** [June 2, 2021, 8:48pm UTC](https://discourse.julialang.org/t/adding-package-issue-with-julia-and-vs-code/62302 "2021-06-02T20:48:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Prani\_Nalluri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/prani_nalluri/32/25752_2.png) [@Prani\_Nalluri](https://discourse.julialang.org/u/Prani_Nalluri)
#### Post date: [June 2, 2021, 8:48pm UTC](https://discourse.julialang.org/t/adding-package-issue-with-julia-and-vs-code/62302/1 "2021-06-02T20:48:27Z")

</div>

Julia was working well on my computer until about last month. It appears that adding packages in the code throws an error. Adding a package in the Julia REPL window in VS Code throws no errors. However, running the actual code in the Julia REPL window after manually doing this still causes errors. The error thrown looks like as is below. The package I tried to add was the Plots package:

```julia
ERROR: LoadError: UndefVarError: Pkg not defined
Stacktrace:
 [1] top-level scope
   @ ~\Documents\Julia\juliaIssue.jl:4
in expression starting at c:\Users\Prani\Documents\Julia\juliaIssue.jl:4

```

The code that was running was

```julia
Pkg.add("Plots")
```

---

<div class="post-metadata">

### Author: ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)
#### Post date: [June 2, 2021, 9:35pm UTC](https://discourse.julialang.org/t/adding-package-issue-with-julia-and-vs-code/62302/2 "2021-06-02T21:35:13Z")

</div>

Did you call `using Pkg` first ?
