Installing Python and Jupyter

Windows

Install python

step 1

set default download location for your browser to C:\Users\<username> (where <username> is your University username)

step 2

Download the latest Python from python.org to C:\Users\<username> (where <username> is your University username)

step 3

Download the latest version of R from cloud.r-project.org to the same location

step 4

Install python by running the installer.

  • make sure both check boxes (Install Launcher and Add to PATH) are ticked

  • click Custmize installation

  • select all features

  • check the box for ‘Install for all users’ (Leave other optons checked as is)

  • change the install location under ‘Customize install location’; change it to C:\Users\<username>\AppData\Local\Programs\Python\Python39 (replace <username> with your username)

  • when prompted, enter your admin account details

  • after ‘Setup was succesfull’ click ‘close’

Install jupyter

step 1

  • open a command prompt

Search for the Command Prompt

alt

Start the Command Prompt

alt

Use the Command Prompt

alt

step 2

run the command

python -m pip install notebook

Install R

step 1

  • run the installer as admin by right clicking and selecting ‘run as admin’

  • enter admin account details when prompted

step 2

select

  • destination location C:\Users\<username>\AppData\Local\Programs\R-4.1.1 (replace <username> with your username)

deselect

  • ‘32-bit Files’

accept all other defaults and follow installer prompts

step 3

add R to the PATH

  • from the Start menu, click the cog icon for settings

  • click on ‘System’

  • on the menu on the left, click ‘About’

  • on the right, under ‘related settings’, click the link for ‘Advanced system settings’

  • enter your admin account details when prompted

  • click ‘Environment Variables…’

  • under ‘System variables’, click on the line for ‘Path’ and then click ‘Edit…’

  • click ‘New’ to add a new entry for C:\Users\<username>\AppData\Local\Programs\R-4.1.1\bin (replace <username> with your username)

click ‘OK’ and close the environment variables and system properties dialogue boxes down.

Install IRkernel package

step 1

Start R by typing

R

step 2

Install the IRKernel package by typing

R> install.packages(“IRkernel”)

at the R prompt

step 3

Configure IRkernel by typing

R> library(IRkernel)

R> IRkernel::installspec()

at the R prompt

Starting Jupyter

You should now be able to start jupyter and open a new notebook that uses the R kernel

step 1

change the drive in you command prompt window to C:

step 2

change the drive in you command prompt window to C: by typing and entering

C:

step 3

enter the following command to open the jupyter notebook

jupyter notebook

alt

Starting a new R kernel in Jupyter

Navigate to your user area (C:\Users\<username>) in the Jupyter Notebook file browser

alt

From the new dropdown dialogue, select R

alt

Start a new R kernel

alt