Skip to content

Commit 4aa2fc0

Browse files
authored
Merge pull request #413 from UBC-DSCI/patch-versions-setup
Patch versions setup
2 parents 3846665 + 05622a9 commit 4aa2fc0

File tree

1 file changed

+93
-56
lines changed

1 file changed

+93
-56
lines changed

setup.Rmd

Lines changed: 93 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Overview
44

5-
In this chapter, you'll learn how to install all of that software
5+
In this chapter, you'll learn how to install all of the software
66
needed to do the data science covered in this book on your own computer.
77

88
## Chapter learning objectives
@@ -16,14 +16,14 @@ By the end of the chapter, readers will be able to do the following:
1616
## Installing software on your own computer
1717

1818
This section will provide instructions for installing the software required by
19-
this book on our own computers.
19+
this book on your own computer.
2020
Given that installation instructions can vary widely based on the computer setup,
2121
we have created instructions for multiple operating systems.
2222
In particular, the installation instructions below have been verified to work
2323
on a computer that:
2424

2525
- runs one of the following operating systems: Ubuntu 20.04, macOS Big Sur (version 11.4.x or 11.5.x), Windows 10 Professional, Enterprise or Education (version 2004, 20H2, or 21H1),
26-
- can connect to networks via a wireless connection,
26+
- has a connection to the internet,
2727
- uses a 64-bit CPU,
2828
- uses English as the default language.
2929

@@ -58,9 +58,10 @@ sudo apt install git
5858

5959
### Miniconda
6060

61-
To run Jupyter notebooks on our computers,
62-
we will need to install the web-based platform JupyterLab.
63-
But JupyterLab relies on Python; we can install this via
61+
To run Jupyter notebooks on your computer,
62+
you will need to install the web-based platform JupyterLab.
63+
But JupyterLab relies on Python, so we need to install Python first.
64+
We can install Python via
6465
the \index{miniconda} [miniconda Python package distribution](https://docs.conda.io/en/latest/miniconda.html).
6566

6667
**Windows:** To install miniconda on Windows, download
@@ -73,35 +74,57 @@ by opening the Start Menu and searching for the program called
7374
When this opens, you will see a prompt similar to
7475
`(base) C:\Users\your_name`.
7576

76-
**MacOS:** To install miniconda on MacOS, download
77+
**MacOS:** To install miniconda on MacOS, you will need to use a different
78+
installation method depending on the type of processor chip your computer has.
79+
80+
If your Mac computer has an Intel x86 processor chip you can download
7781
the [latest Python 64-bit version from here](https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.pkg).
7882
After the download has finished, run the installer and accept the default
7983
configuration for all pages.
8084

81-
**Ubuntu:** To install miniconda on Ubuntu, we first download
85+
If your Mac computer has an Apple M1 processor chip you can download
86+
the [latest Python 64-bit version from here](https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh).
87+
After the download has finished, you need to run the downloaded script in the terminal using a command
88+
like:
89+
90+
```
91+
bash path/to/Miniconda3-latest-MacOSX-arm64.sh
92+
```
93+
94+
Make sure to replace `path/to/` with the path of the folder
95+
containing the downloaded script. Most computers will save downloaded files to the `Downloads` folder.
96+
If this is the case for your computer, you can run the script in the terminal by typing:
97+
98+
```
99+
bash Downloads/Miniconda3-latest-MacOSX-arm64.sh
100+
```
101+
102+
The instructions for the installation will then appear.
103+
Follow the prompts and agree to accepting the license,
104+
the default installation location,
105+
and to running `conda init`, which makes `conda` available from the terminal.
106+
107+
**Ubuntu:** To install miniconda on Ubuntu, first download
82108
the [latest Python 64-bit version from here](https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh).
83109
After the download has finished, open the terminal and execute the following
84-
commands:
110+
command:
85111

86112
```
87113
bash path/to/Miniconda3-latest-Linux-x86_64.sh
88114
```
89115

90-
> **Note:** Most often, this file is downloaded to the Downloads directory,
91-
and thus the command will look like this:
92-
> ```
93-
> bash Downloads/Miniconda3-latest-Linux-x86_64.sh
94-
> ```
95-
116+
Make sure to replace `path/to/` with the path of the folder containing the downloaded
117+
script. Most often this file will be downloaded to the `Downloads` folder.
118+
If this is the case for your computer, you can run the script in the terminal by typing:
96119

97-
The instructions for the installation will then appear:
98-
99-
(1) Press Enter.
100-
(2) Once the license agreement shows, you can press space scroll down or press `q` to skip reading it.
101-
(3) Type `yes` and press enter to accept the license agreement.
102-
(4) Press Enter to accept the default installation location.
103-
(5) Type `yes` and press enter to instruct the installer to run `conda init`, which makes `conda` available from the terminal/shell.
120+
```
121+
bash Downloads/Miniconda3-latest-Linux-x86_64.sh
122+
```
104123

124+
The instructions for the installation will then appear.
125+
Follow the prompts and agree to accepting the license,
126+
the default installation location,
127+
and to running `conda init`, which makes `conda` available from the terminal.
105128

106129
### JupyterLab
107130

@@ -121,52 +144,64 @@ tab in your default browser with the JupyterLab interface. To exit out of
121144
JupyterLab you can click `File -> Shutdown`, or go to the terminal from which
122145
you launched JupyterLab, hold `Ctrl`, and press `C` twice.
123146

124-
### R and the IRkernel
125-
126-
To have R \index{R!installation} available to you in JupyterLab,
127-
you will need to install the R programming language and the \index{kernel!installation} IRkernel R package.
128-
To install these, type the following into
129-
the Anaconda Prompt (Windows) or terminal (MacOS and Ubuntu):
130-
131-
```
132-
conda install -c conda-forge -y r-base">=4.1.1"
133-
conda install -c conda-forge -y r-irkernel
134-
```
135-
136-
To improve the experience of using R in JupyterLab, we will add an extension
137-
that allows us to set up keyboard shortcuts for inserting text.
147+
To improve the experience of using R in JupyterLab, you should also add an extension
148+
that allows you to set up keyboard shortcuts for inserting text.
138149
By default,
139150
this extension creates shortcuts for inserting two of the most common R
140151
operators: `<-` and `|>`. Type the following in the Anaconda Prompt (Windows)
141-
or terminal (MacOS and Ubuntu) and press enter:
152+
or terminal (MacOS and Ubuntu) and press enter:
142153

143154
```
144155
jupyter labextension install @techrah/text-shortcuts
145156
```
146157

147-
### R packages
158+
### R, R packages, and the IRkernel
148159

149-
To install the packages \index{package} used in this book,
150-
type the following in the Anaconda Prompt (Windows)
151-
or terminal (MacOS and Ubuntu) and press enter:
160+
To have the software \index{R!installation} used in this book available to you in JupyterLab,
161+
you will need to install the R programming language,
162+
several R packages,
163+
and the \index{kernel!installation} IRkernel.
164+
To install versions of these that are compatible with the accompanying worksheets,
165+
type the command shown below into the Anaconda Prompt (Windows)
166+
or terminal (MacOS and Ubuntu).
152167

153168
```
154-
conda install -c conda-forge -y \
155-
r-cowplot \
156-
r-ggally \
157-
r-gridextra \
158-
r-kknn \
159-
r-rodbc \
160-
r-rpostgres \
161-
r-rsqlite \
162-
r-scales \
163-
r-testthat \
164-
r-tidymodels \
165-
r-tidyverse \
166-
r-tinytex \
167-
unixodbc
169+
conda env update --file https://raw.githubusercontent.com/UBC-DSCI/data-science-a-first-intro-worksheets/main/environment.yml
168170
```
169171

172+
This command installs the specific R and package versions specified in
173+
the `environment.yml` file found in
174+
[the worksheets repository](https://ubc-dsci.github.io/data-science-a-first-intro-worksheets).
175+
We will always keep the versions in the `environment.yml` file updated
176+
so that they are compatible with the exercise worksheets that accompany the book.
177+
178+
> You can also install the *latest* version of R
179+
> and the R packages used in this book by typing the commands shown below
180+
> in the Anaconda Prompt (Windows)
181+
> or terminal (MacOS and Ubuntu) and pressing enter.
182+
> **Be careful though:** this may install package versions that are
183+
> incompatible with the worksheets that accompany the book; the automated
184+
> exercise feedback might tell you your answers are not correct even though
185+
> they are!
186+
>
187+
> ```
188+
> conda install -c conda-forge -y \
189+
> r-base \
190+
> r-cowplot \
191+
> r-ggally \
192+
> r-gridextra \
193+
> r-irkernel \
194+
> r-kknn \
195+
> r-rpostgres \
196+
> r-rsqlite \
197+
> r-scales \
198+
> r-testthat \
199+
> r-tidymodels \
200+
> r-tidyverse \
201+
> r-tinytex \
202+
> unixodbc
203+
> ```
204+
170205
### LaTeX
171206
172207
To be able to render `.ipynb` files to `.pdf` you need to install a LaTeX
@@ -232,8 +267,10 @@ to save and close the file.
232267
233268
It is good practice to restart all the programs you used when installing this
234269
software stack before you proceed to doing your data analysis.
270+
This includes restarting JupyterLab as well as the terminal (MacOS and Ubuntu)
271+
or the Anaconda Prompt (Windows).
235272
This will ensure all the software and settings you put in place are
236-
correctly sourced. This includes JupyterLab, terminal or Anaconda Prompt.
273+
correctly sourced.
237274
238275
## Downloading the worksheets for this book
239276

0 commit comments

Comments
 (0)