Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Pkg
- startup_packages = [:OhMyREPL, :DataStructures]
- for pack in startup_packages
- try
- eval(:(using $(pack)))
- printstyled("$(pack) is loaded.\n"; color=:light_green)
- catch e
- if isa(e, ArgumentError)
- printstyled("The $(pack) isn't installed loaded.\nIntalling $(pack).\n"; color=:light_blue)
- Pkg.add("$(pack)")
- end
- eval(:(using $(pack)))
- end
- end
- println()
- # Check whether any package at 'needed_packages' are installed.
- # Case it's not installed, install them.
- data_science = [:Plots, :DataFrames, :ScikitLearn, :IJulia, :CSV, :Spark, :JDBC, :ODBC]
- machine_learning = [:MLJ, :Flux, :Lux, :Metalhead, :ObjectDetector, :TextAnalysis, :Turing]
- web = [:Genie]
- needed_packages = vcat(data_science, machine_learning, web)
- for pack in needed_packages
- try
- printstyled("Checking if package $(pack) is installed: "; color=:light_cyan)
- isdir(Pkg.dir("$(pack)"))
- printstyled("Ok\n"; color=:light_green)
- catch e
- if isa(e, MethodError)
- printstyled("The $(pack) isn't installed loaded.\nIntalling $(pack).\n"; color=:light_magenta)
- Pkg.add("$pack")
- end
- end
- end
- println()
Advertisement
Add Comment
Please, Sign In to add comment