Some understanding of Julia would be a bonus.
In this book, we use many Julia packages. Here, we provide an installation script for those packages.
This script can be also found in the GitHub repository in the cookbookconf.jl file.
All packages are installed and pinned in a concrete version that ensures that they will work correctly with the recipes given in the book. More information about managing packages can be found in the Managing Packages recipe in Chapter 1, Installing and Setting Up Julia.
If you do not pin the packages to the required version, they might still work, but it is possible that newer versions of some packages introduce non-compatible API changes, in which case the codes of the recipes might need small alterations to make them run.
We have divided packages into three groups:
- Packages that do not depend on external software
- Packages that can optionally depend on an external Anaconda Python installation
- Packages that require external software to be run.
For each package group, we provide an installation script that installs exactly the same version that we have used in the book.
All the packages listed are installed by calling the following function:
using Pkg
function addandpin(spec)
Pkg.add(PackageSpec(; spec...))
Pkg.pin(spec.name)
end
Packages that do not depend on external software can be installed with the following commands:
pkg1 = [(name="StatsBase", version="0.26.0"),
(name="TimeZones", version="0.8.1"),
(name="BSON", version="0.2.1"),
(name="Revise", version="0.7.12"),
(name="Distributions", version="0.16.4"),
(name="Clp", version="0.5.0"),
(name="HTTP", version="0.7.1"),
(name="Gumbo", version="0.5.1"),
(name="StringEncodings", version="0.3.1"),
(name="ZMQ", version="1.0.0"),
(name="CodecZlib", version="0.5.0"),
(name="JSON", version="0.19.0"),
(name="BenchmarkTools", version="0.4.1"),
(name="JuliaWebAPI", version="0.5.0"),
(name="FileIO", version="1.0.2"),
(name="ProfileView", version="0.4.0"),
(name="StaticArrays", version="0.8.3"),
(name="ForwardDiff", version="0.9.0"),
(name="Optim", version="0.17.1"),
(name="JuMP", version="0.18.4"),
(name="JLD2", version="0.1.2"),
(name="XLSX", version="0.4.2"),
(name="Cbc", version="0.4.2"),
(name="DataFrames", version="0.14.1"),
(name="CSV", version="0.4.3"),
(name="DataFramesMeta", version="0.4.0"),
(name="Feather", version="0.5.0"),
(name="FreqTables", version="0.3.0"),
(name="OnlineStats", version="0.19.1"),
(name="MySQL", version="0.7.0"),
(name="Cascadia", version="0.4.0"),
(name="UnicodePlots", version="0.3.1"),
(name="ParallelDataTransfer", version="0.5.0")]]
foreach(addandpin, pkg1)
Packages that can optionally depend on an external Python Anaconda installation (refer to the Calling Python from Julia recipe in Chapter 8, Julia Workflow, for details) can be installed with the following commands:
pkg2 = [(name="Conda", version="1.0.2"),
(name="PyCall", version="1.18.4"),
(name="PyPlot", version="2.6.3"),
(name="Plots", version="0.20.5"),
(name="StatPlots", version="0.8.1")]
foreach(addandpin, pkg2)
Some packages require external software to be installed. This includes the RCall.jl, JDBC.jl, LibPQ.jl and Gurobi.jl packages. Before installing those packages, make sure that the required software is installed on your system. For the RCall.jl package, check the Calling R from Julia recipe in Chapter 8, Julia Workflow, for JDBC.jl and LibPQ.jl, check the Working with databases in Julia recipe, and for Gurobi.jl, check the Optimization using JuMP recipe; both recipes can be found in Chapter 9, Data Science. Once you make sure that all software dependencies are installed, you can use the following commands:
pkg3 = [(name="RCall", version="0.12.1"),
(name="JDBC", version="0.4.0"),
(name="LibPQ", version="0.5.0"),
(name="Gurobi", version="0.5.3")]
foreach(addandpin, pkg3)