Julia 101
Lesson 2: Setting Up Your Environment
As the subtitle suggests, this lesson discusses the installation of Julia on a windows machine. Currently stable and Long Term Support (LTS) releases of Julia are available on its official webpage. Follow below mentioned steps to download and install.
- Go to https://julialang.org/downloads/
- Grab the currently stable or LTS release depending upon your system architecure i.e. 32 bit or 64 bit
- After downloading, double click on installer package and follow the instructions to finish installation.
- Once installation is complete, fire up Command Prompt, type
julia
and hitEnter
. If everything is installed correctly, Julia REPL will be opened and we are good to go.
A shortcut icon will also be available to you to launch Julia REPL, directly from your desktop or Start Menu. We can now, write our first program and as usual, it is “Hello World!”
print("Hello World!")
Before diving deep into coding, let’s take a deep breath and we look into available IDEs, we can use, to increase our productivity. Julia provides us a number of options here. Some popular ones are:
- Juno: Atom Plugin
- VS Code Extension
- Jupyter Notebook
- Pluto
In future lessons, we are going to use either VS Code or Jupyter Notebook to write our programs. Details for setting them up, goes here:
VS Code
- Start VS Code.
- Inside VS Code, go to the extensions view either by executing the
View: Show Extensions
command (click View->Command Palette...) or by clicking on the extension icon on the left side of the VS Code window. - In the extensions view, simply search for the term
julia
in the marketplace search box, then select the extension namedJulia
and click the install button. You might have to restart VS Code after this step.
Jupyter Notebook
Run Julia REPL, either by using Command Prompt or Start Menu and at the julia>
prompt, press ]
, type hit add IJulia
and hit Enter
.
If you already have Python/Jupyter installed on your machine, this process will also install a kernel specification that tells Jupyter how to launch Julia. You can then launch the notebook server the usual way by running jupyter notebook
in the terminal.
Alternatively, you can have IJulia create and manage its own Python/Jupyter installation. To do this, type the following in Julia, at the julia>
prompt:
using IJulia
notebook()
to launch the IJulia notebook in your browser. The first time you run notebook()
, it will prompt you for whether it should install Jupyter. Hit enter to have it use the Conda.jl package to install a minimal Python+Jupyter distribution (via Miniconda) that is private to Julia (not in your PATH
).
Thats all for this lesson. Stay tune for next:)