# 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:** 21

<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 8, 2019, 1:21am UTC](https://discourse.julialang.org/t/how-to-add-a-package-but-only-if-it-is-not-already-there/30674/21 "2019-11-08T01:21:13Z")

</div>

So I include a snippet over in this other thread I linked above that does exactly what you’re asking for. I agree with many of the poster’s above me that it might not be a good idea, though. Use at your own risk.

> [@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)._
