# Why do I get this error when ever I add a new package?

**URL:** <https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921>\
**Category:** New to Julia\
**Tags:** question, package\
**Created:** [December 21, 2023, 7:37pm UTC](https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921 "2023-12-21T19:37:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sabe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sabe/32/212556_2.png) [@Sabe](https://discourse.julialang.org/u/Sabe)\
**Post date:** [December 21, 2023, 7:37pm UTC](https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921/1 "2023-12-21T19:37:50Z")

</div>

ok so whenever I add a new package to a project no matter what it is when I try to run it I get this `ERROR: LoadError: ArgumentError: Package X not found in current path.` even though I did `] add X` right now I am using sdl and idk what to do to fix this

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [December 21, 2023, 7:44pm UTC](https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921/2 "2023-12-21T19:44:15Z")

</div>

What is your operating system? How did you install Julia? What is the output of:

```julia
versioninfo()

```

---

<div class="post-metadata">

**Author:** ![Sabe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sabe/32/212556_2.png) [@Sabe](https://discourse.julialang.org/u/Sabe)\
**Post date:** [December 21, 2023, 8:14pm UTC](https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921/3 "2023-12-21T20:14:56Z")

</div>

I am on windows 11, I used the installer and I get this `Julia Version 1.9.4 Commit 8e5136fa29 (2023-11-14 08:46 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: 8 × AMD Ryzen 3 5300G with Radeon Graphics WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-14.0.6 (ORCJIT, znver3) Threads: 1 on 8 virtual cores Environment: JULIA_EDITOR = code JULIA_NUM_THREADS =`

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [December 21, 2023, 8:40pm UTC](https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921/4 "2023-12-21T20:40:08Z")

</div>

Which package are you trying to install?

What happens if you type in a terminal window:

```julia
mkdir test
cd test
julia --project="."

```

and then, on the Julia prompt type:

```julia
using Pkg
Pkg.add("DataFrames")

```

Just as example.

Extra question:  
Does your home directory, which usually has the name of your username contain any space or special character?

And if you post any code or output, please enclose it in triple backticks, like this: ```

---

<div class="post-metadata">

**Author:** ![Sabe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sabe/32/212556_2.png) [@Sabe](https://discourse.julialang.org/u/Sabe)\
**Post date:** [December 21, 2023, 8:47pm UTC](https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921/5 "2023-12-21T20:47:31Z")

</div>

I am trying to install SDL

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [December 21, 2023, 8:50pm UTC](https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921/6 "2023-12-21T20:50:09Z")

</div>

More interestingly, how are you executing your code, and what is the output of `] st`?

---

<div class="post-metadata">

**Author:** ![Sabe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sabe/32/212556_2.png) [@Sabe](https://discourse.julialang.org/u/Sabe)\
**Post date:** [December 21, 2023, 8:52pm UTC](https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921/7 "2023-12-21T20:52:20Z")

</div>

so my file is called SDLJulia.jl and I do julia SDLJulia.jl and the status is this `Project SDLJulia v0.1.0 Status `C:\Users\swirl\OneDrive\Desktop\Julia\SDLJulia\Project.toml` [98e33af6] SimpleDirectMediaLayer v0.4.0`

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [December 21, 2023, 9:30pm UTC](https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921/8 "2023-12-21T21:30:47Z")

</div>

Well, if you work with local projects you need to launch julia with

```julia
julia --project

```

So what is the output if you launch Julia with the parameter --project in the folder `C:\Users\swirl\OneDrive\Desktop\Julia\SDLJulia\` and then type:

```julia
using SimpleDirectMediaLayer

```

If that works, you installed this package successfully, if not please post the error message in triple backticks.

And if you want to execute the file “SDLJulia.jl” please include it from the command line like this:

```julia
include("SDLJulia.jl")

```

after launching Julia with the parameter `--project`.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [December 21, 2023, 9:40pm UTC](https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921/9 "2023-12-21T21:40:14Z")

</div>

Just tested this on Windows 10 and it works for me, so the package is not broken.

Explanation:  
Many people install everything in the global environment (never launch Julia with the parameter --project), and then they might get into trouble if some old packages do not play well together with new packages…

Better to have a Project.toml file per project and install in each project (=folder) only the packages needed for that project…
