9.1. Installing Julia and some useful add-ons#

Remark 9.1 (TO DO)

Reformat using package prf.

To use Julia with the code and notebook in this book, there are several steps:

  1. Install the Julia language itself

  2. Make Julia usable in notebooks

    1. Install Anaconda, which contains the JupyerLab notebook tool.

    2. Enable use of Julia from within JupyerLab.

  3. Install a few additional packages (Step 3 can be done before step 2.)

Installing Julia#

Get it from the Julia download site.

Installing Anaconda (for Jupyterlab)#

First, download the installer from www.anaconda.com. This page should detect your OS and hardware type (i.e. x86 or Apple silicon) and point you to the appropriate version. If not, click the logo for your OS below and select from the list.

Installation (at least on macOS) might best be done by deviating from the default, which is to install for the current user only, inside your file space (in cse I supose you do not have admin pvivileges to put it elsewhere.) If instead you want it available to all users in the standard place, select “Install on a specific disk” and then navigate to the appropriate folder.

Enabling Julia in JupyterLab#

This is done by adding package “IJulia”, so read on.

Adding some useful Julia packages#

The following Pkg.add commands should only need to be done “once per computer”; each one requires first making Pkg available with

using Pkg

All these commands can be done with the basic Julia comand line tool installed as above; alternativel once IJulia is installed, they can be run from a notebook; for example by running this one.

Package “IJulia”, which enables Julia in JupyterLab#

This adds the option of creating and using Jupyter notebooks that use Julia to the basic option of Python; it also adds the option of opening a Julia console as a tab inside JupyterLab, for running Julia commands interactively.

Pkg.add("IJulia")

Use an interface to the Python package Matplotlib.pyplot#

Pkg.add("PyPlot")

Deployed in a particular notebook or Julia session with

using PyPlot

Allow LaTeX notation in creating strings, using prefix “L”.#

For example L”y = \cos(x^2)” gives \(y = \cos(x^2)\)

Pkg.add("LaTeXStrings")

Deployed with

using LaTeXStrings

Add some random number stuff#

Pkg.add("Random")

Deploy with

using Random