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

if this for your script and you just want to see if a package exists or not, How to test if package is installed - #2 by fengyang.wang

if you’re making a module with optional dependency, maybe you can try Requires.jl