This repository contains introductory materials for learning Julia and JuMP.
This README will walk you through how to install Julia and IJulia.
If you have trouble installing, please open a Github issue.
To get started, you first need to install Julia.
- Download and install the Current stable release version of Julia from https://julialang.org/downloads/.
- Read the Platform-specific instructions
- If in doubt, choose the 64-bit version of Julia
Next, you need to download a copy of these materials.
If you have git
installed
cd
to an appropriate directory, then run
git clone https://github.com/odow/jump-training-materials
If you don't have git
installed
Download this zip file. Once downloaded, unzip it to an appropriate location.
Now open Julia, either by typing julia
at a terminal, or by launching the icon
from wherever you installed it.
Once open, you should be faced with the Julia REPL that looks like this:
Now we need to install some packages. In the Julia REPL, run the following commands:
cd("/full/path/to/where/you/installed/jump-training-materials")
import Pkg
Pkg.activate(".")
Pkg.instantiate()
Pkg.build("IJulia")
WARNING: it may take a few minutes to download and compile all the packages! The good news is that you only have to run this command once.
- On Mac and Linux,
cd("~")
may throw an error instead ofcd
ing to your home directory:To fix, type the full path to the home directory, or typejulia> cd("~") ERROR: IOError: cd("~"): no such file or directory (ENOENT) Stacktrace: [1] uv_error @ ./libuv.jl:97 [inlined] [2] cd(dir::String) @ Base.Filesystem ./file.jl:85 [3] top-level scope @ REPL[1]:1
cd("~
, then press theTAB
key.
Okay, last step, let's launch a Jupyter notebook! Open a Julia REPL and then run:
cd("/full/path/to/where/you/installed/jump-training-materials")
Pkg.activate(".")
using IJulia
IJulia.notebook(dir=".")
If all goes well, a browser window will open that looks like this:
To get started on the content portion of the tutorials, click on the first
notebook entitled getting_started_with_julia.ipynb
. Then click
"Cell > "Run All".
If things are sucessful, all of the cells should run (some will error on purpose). You're now ready to follow along with the live training.
If things don't work, please open a Github issue with a screenshot of what went wrong.
- Don't start Jupyter via Anaconda! There are some version differences that cause problems.
I will continue to update these materials over time. To update the materials you previous installed:
If you have git
installed
git pull
the latest changes. All of the packages will remain installed, so the
only thing that will change are the Jupyter notebooks.
- If you made changes to a notebook that was updated,
git
will throw an error sayingerror: Your local changes to the following files would be overwritten by merge:
indicating the corresponding notebooks. If the changes can be discarded, dogit checkout notebook_name.ipynb
and then trygit pull
again.
If you don't have git
installed
Download a new copy of the zip file, and then copy-paste the new notebooks into the old directory. There is no need to re-run the other installation steps.