# How to add a package but only if it is not already there?

**URL:** <https://discourse.julialang.org/t/how-to-add-a-package-but-only-if-it-is-not-already-there/30674>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 4, 2019, 4:40am UTC](https://discourse.julialang.org/t/how-to-add-a-package-but-only-if-it-is-not-already-there/30674 "2019-11-04T04:40:29Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [November 6, 2019, 9:55pm UTC](https://discourse.julialang.org/t/how-to-add-a-package-but-only-if-it-is-not-already-there/30674/8 "2019-11-06T21:55:34Z")

</div>

> [@ffevotte](#):
>
> Not sure if it’s useful / clean, but I have this function in some scripts that I use to setup new environments:

This is more or less what I ended up doing.

> [@Using LanguageServer.jl with eglot in emacs](https://discourse.julialang.org/t/using-languageserver-jl-with-eglot-in-emacs/23125/38):
>
> LanguageServer.jl eglot integration is now packaged up at [https://github.com/non-Jedi/jleglot](https://github.com/non-Jedi/jleglot) and I just created a pending PR to melpa at [https://github.com/melpa/melpa/pull/6531](https://github.com/melpa/melpa/pull/6531). Hope it’s helpful to y’all. slight_smile For anyone wondering how I ended up making sure the project was instantiated, I stole a page from the Revise playbook: try @eval using LanguageServer catch @warn "Unable to import LanguageServer. Instantiating project." Pkg.instantiate() @eval using LanguageS…

---

_[View the full topic](https://discourse.julialang.org/t/how-to-add-a-package-but-only-if-it-is-not-already-there/30674)._
