Skip to content

Instantly share code, notes, and snippets.

@ollin18
Created May 3, 2019 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ollin18/847f7e294fc5fa6011eaa9060f1d8f92 to your computer and use it in GitHub Desktop.
Save ollin18/847f7e294fc5fa6011eaa9060f1d8f92 to your computer and use it in GitHub Desktop.
Function to load a bunch of packages and install them if not already
using Pkg
function useit(list::Array{Symbol})
installed = [key for key in keys(Pkg.installed())]
strpackages = @. string(list)
uninstalled = setdiff(strpackages,installed)
map(Pkg.add,uninstalled)
for package ∈ list
@eval using $package
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment