Installation
-
You will need to install Julia. We will use the latest version, i.e. version 1.8. Versions earlier than julia 1.0 will not work. If you have any issue, please have a look to the installation instructions for more details. (Note however it is not necessary to add julia to the Windows
PATH
environement variable). -
Install the following julia packages by executing the following lines in a julia terminal:
These two packages can be installed using the following commands.
using Pkg
Pkg.add(["NCDatasets","PyPlot","Interpolations","DIVAnd","IJulia"])
using PyPlot
using IJulia
notebook()
This installs DIVAnd
, IJulia
, the graphical notebook interface to Julia (highly recommended for the workshop) and PyPlot
for the plotting among others.
Installation can take a couple of minutes and will take about 3 GB of disk space.
Copying and pasting commands in a terminal
Windows user should have a look at this to enable the quick edit mode to facilitate copying and pasting commands.
Testing your installation
- In the Julia terminal, issue the following command to test
DIVAnd
:
using Pkg
Pkg.test("DIVAnd");
All tests should succeed but it might need some time to execute completely (you will need an active internet connection). Be patient.
- Testing
PyPlot
. Again in the Julia terminal, issue the following commands:
using PyPlot
plot(1:10)
A new window should open with a straight line.
- Testing
IJulia
. Issue the following commands in a Julia terminal:
using IJulia
notebook()
A new browser window should open. Then, click on New => Julia 1.x (where 1.x is you julia version). In the text box, type 1+2
and then hit Control-Enter
. The answer should be 3! Normally your notebook should open in your home directory so you see the files/directories you have there.
If this does not work, please report the issue here with the full error message: https://github.com/gher-ulg/Diva-Workshops/issues/new
If you want to see another directory tree, you can try to open the browser interface with
using IJulia
notebook(dir="D:/myotherdirectory/onanotherdisk/")
For issues with IJulia/Jupyter please have a look at https://github.com/JuliaLang/IJulia.jl.
First steps with Jupyter and Julia
If you modify DIVAnd
module, restart the kernel to make sure latest version is
used (remember, Julia does some compilations).
Updating Julia
- Download binaries, install as usual.
- Run in Julia (NOT IJulia of Jupyter):
Pkg.build("IJulia")
- Then (in IJulia or Julia)
Pkg.update()
More information is available at: https://github.com/JuliaLang/IJulia.jl#updating-julia-and-ijulia
Troubleshooting
For any installation issue please have a look at:
If the installation does not work, please report the issue here with the full error message: https://github.com/gher-ulg/Diva-Workshops/issues/new
IJulia
- If Julia is installed/run as administator, IJulia cannot open a working web-browser. If the url is copied into another chrome instance (with internet working), then jupyter works.