Skip to content

Commit 6b46e36

Browse files
Update set-up page and slides (#66)
1 parent 36fc40f commit 6b46e36

2 files changed

Lines changed: 92 additions & 103 deletions

File tree

docs/setup.md

Lines changed: 89 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,84 @@ layout: default
66

77
To get started, you should have the following three elements setup:
88

9-
1. Install Python and the required Python packages
10-
2. Download the course material to your computer
9+
1. Download the course material to your computer
10+
2. Install Python and the required Python packages using `conda`
1111
3. Test your configuration and installation
1212
4. Start Jupyter lab
1313

1414
In the following sections, more details are provided for each of these steps. When all three are done, you are ready to start coding!
1515

16-
## 1. (_before the course_) Install Python and the required Python packages
16+
## 1. Getting the course materials
1717

18-
For scientific and data analysis, we recommend to use Anaconda (or Miniconda) (<https://www.anaconda.com/download/>), which provides a Python
19-
distribution that includes the scientific libraries (this recommendation applies to all platforms, so for both Windows, Linux and Mac),
20-
instead of installing Python as such. After installation, proceed with the setup.
18+
### Option 1: You are already a git user
2119

22-
### Install Anaconda
20+
As the course has been set up as a [git](https://git-scm.com/) repository managed on [Github](https://github.com/jorisvandenbossche/DS-python-geospatial),
21+
you can clone the entire course to your local machine. Use the command line to clone the repository and go into the course folder:
2322

24-
#### Option 1: I do not have Anaconda installed
23+
```
24+
git clone https://github.com/jorisvandenbossche/DS-python-geospatial.git
25+
cd DS-python-geospatial
26+
```
2527

26-
For first time users and people not fully confident with using the command line, we advise to install Anaconda, by downloading and installing
27-
the Python 3.x version from <https://www.anaconda.com/download/>. Recent computers will require the 64-Bit installer.
28+
In case you would prefer using Github Desktop,
29+
see [this tutorial](https://help.github.com/desktop/guides/contributing-to-projects/cloning-a-repository-from-github-to-github-desktop/).
2830

29-
For more detailed instructions to install Anaconda, check the [Windows](https://docs.anaconda.com/anaconda/install/windows/),
30-
[Mac](https://docs.anaconda.com/anaconda/install/mac-os/) or [linux](https://docs.anaconda.com/anaconda/install/linux/) installation tutorial.
31+
### Option 2: You are not a git user
3132

32-
**Note:** When you are already familiar with the command line and Python environments you could opt to use Miniconda instead of Anaconda
33-
and download it from <https://conda.io/miniconda.html>. The main difference is that Anaconda provides a graphical user interface (Anaconda navigator)
34-
and a whole lot of scientific packages (e.g <https://docs.anaconda.com/anaconda/packages/py3.9_win-64/>) when installing, whereas for Miniconda
35-
the user needs to install all packages using the command line. On the other hand, Miniconda requires less disk space.
33+
To download the repository to your local machine as a zip-file, click the `download ZIP` on the
34+
repository page <https://github.com/jorisvandenbossche/DS-python-geospatial> (green button "Code"):
3635

37-
#### Option 2: I have installed Anaconda earlier
36+
![Download button](./static/img/download-button.png)
3837

39-
When you already have an installation of Anaconda, you have to make sure you are working with the most recent versions. As the course is
40-
developed for Python 3, make sure you have Anaconda3 (on Windows, check Start > Programs > Anaconda3). If not, reinstall Anaconda according
41-
to the previous section.
38+
After the download, unzip on the location you prefer within your user account (e.g. `My Documents`, not `C:\`). Watch out for a nested 'DS-python-geospatial/DS-python-geospatial' folder structure after unzipping and move the inner DS-python-geospatial folder to your preferred location.
4239

43-
Start the Anaconda Navigator program (for Windows users: Start > Anaconda Navigator) and go to the Environments tab. You should see
44-
the *base (root) environment*, click the arrow next to it and click `Open terminal`, as shown in the following figure:
40+
__Note:__ Make sure you know where you stored the course material, e.g. `C:/Users/yourusername/Documents/DS-python-geospatial`.
4541

46-
![Navigator terminal](./static/img/navigator_terminal.png)
42+
## 2. Install Python and the required Python packages using `conda`
4743

48-
Type following command + ENTER-button (make sure you have an internet connection):
44+
For scientific and data analysis, we recommend to use `conda`, a command line
45+
tool for package and environment management (<https://docs.conda.io/projects/conda/>).
46+
`conda` allows us to install a Python distribution with the the scientific libraries
47+
we will use in this course (this recommendation applies to all
48+
platforms, so for both Windows, Linux and Mac).
4949

50-
```
51-
conda update -n base conda
52-
```
53-
and respond with *Yes* by typing `y`. Packages should be updated after the completion of the command.
50+
### 2.1 Install `conda`
5451

55-
### Setup after Anaconda installation
52+
#### Option 1: I do not have `conda` installed
5653

57-
As not all packages we will use in the course are provided by default as part of Anaconda, we have to add the package to Anaconda to get started.
58-
As a good practice, we will create a new _conda environment_ to work with. This environment will contain the required packages on which this
59-
course depends.
54+
We recommend to use the installer provided by the conda-forge community: <https://conda-forge.org/download/>.
55+
56+
Follow the instructions on that page, i.e. first download the appropriate
57+
installed (depending on your operating system), and then run that installer.
58+
59+
On Windows, this will mean double-clicking the downloaded `.exe` file, and
60+
following the instructions. During installation, choose the options (click checkbox):
61+
62+
- '_Register Miniforge3 as my default Python 3.12_' (in case this returns an error about an existing Python 3.12 installation, remove the existing Python installation using [windows Control Panel](https://support.microsoft.com/en-us/windows/uninstall-or-remove-apps-and-programs-in-windows-4b55f974-2cc6-2d2b-d092-5905080eaf98)).
63+
- '_Clear the package cache upon completion_'.
64+
65+
On MacOS or Linux, you have to open a terminal,
66+
and run `bash Miniforge3-$(uname)-$(uname -m).sh`
67+
68+
#### Option 2: I already have `conda`, Anaconda or Miniconda installed
69+
70+
When you already have an installation of `conda` or Anaconda, you have to make
71+
sure you are working with a recent version. If you installed it only a few
72+
months ago, this step is probably not needed, otherwise follow the next steps:
73+
74+
1. Open a terminal window (on Windows, use the dedicated "Anaconda Prompt" or "Miniforge Prompt", via Start Menu)
75+
2. Run `conda update conda`, by typing that command, hit the ENTER-button
76+
(make sure you have an internet connection), and respond with *Yes* by typing `y`.
77+
3. Run `conda config --add channels conda-forge`, by typing that command, hit the ENTER-button
78+
4. Run `conda config --set channel_priority strict`, by typing that command, hit the ENTER-button
79+
80+
If you are using Anaconda on Windows, replace each time "Miniforge Prompt" by "Anaconda Prompt" in the following sections.
81+
82+
### 2.2 Setup after `conda` installation
83+
84+
Now we will use `conda` to install the Python packages we are going to use
85+
throughout this course.
86+
As a good practice, we will create a new _conda environment_ to work with.
6087

6188
The packages used in the course are enlisted in
6289
an [`environment.yml` file](https://raw.githubusercontent.com/jorisvandenbossche/DS-python-geospatial/main/environment.yml). The file looks as follows:
@@ -66,7 +93,7 @@ name: DS-geospatial
6693
channels:
6794
- conda-forge
6895
dependencies:
69-
- python=3.11
96+
- python=3.12
7097
- geopandas
7198
- ...
7299
```
@@ -76,45 +103,34 @@ The file contains information on:
76103
- `channels` to define where to download the packages from
77104
- `dependencies` contains each of the packages
78105

79-
To download the environment file, click to go to
80-
the [environment.yml](https://raw.githubusercontent.com/jorisvandenbossche/DS-python-geospatial/main/environment.yml) online. Once opened in the
81-
browser, right-click and save the file/page on your computer. The specific text depends on your browser (`Save page as...`, `Save as...`).
106+
The environment.yml file for this course is included in the course material you
107+
downloaded.
82108

83-
__WARNING !__ Make sure you save the file as `environment.yml` instead of `environment.yml.txt` which, specifically on Windows operating system,
84-
might be the default option. To do so, choose for 'save as type' _All Files_ instead of 'Text Document'.
109+
Now we can create the environment:
85110

86-
![](./static/img/environment_save.png)
111+
1. Open the terminal window (on Windows use "Miniforge Prompt", open it via Start Menu > 'Miniforge Prompt')
112+
2. Navigate to the directory where you downloaded the course materials (that
113+
directory should contain a `environment.yml` file, double check in your file explorer):
87114

88-
You will need the folder/directory containing the `environment.yml` file in the next step. Make sure you know where you stored the file on
89-
your computer, e.g. when stored in the folder `C:/Users/yourusername/Documents` you should see the file `environment.yml` in File Explorer
90-
in that directory.
115+
```
116+
cd FOLDER_PATH_TO_COURSE_MATERIAL
117+
```
91118

92-
Next, start the Anaconda Navigator program (for windows users: Start > Anaconda Navigator) and go to the Environments tab. You should see
93-
the *base (root) environment*, click the arrow next to it and click `Open terminal`, as shown in the following figure:
119+
3. Create the environment by typing the following commands line by line +
120+
hitting the ENTER-button (make sure you have an internet connection):
94121

95-
![Navigator terminal](./static/img/navigator_terminal.png)
122+
```
123+
conda env create -f environment.yml
124+
```
96125

97-
Type following commands line by line + ENTER-button (make sure you have an internet connection):
98-
99-
```
100-
conda install -n base conda-libmamba-solver
101-
conda config --set solver libmamba
102-
conda config --add channels conda-forge
103-
conda config --set channel_priority strict
104-
cd FOLDER_PATH_TO_ENVIRONMENT_FILE
105-
conda env create -f environment.yml
106-
```
126+
__!__ `FOLDER_PATH_TO_COURSE_MATERIAL` should be replaced by the path to the
127+
folder containing the downloaded course materials (e.g. in the example it is `C:/Users/yourusername/Documents/DS-python-geospatial`)
107128

108-
__!__ `FOLDER_PATH_TO_ENVIRONMENT_FILE` should be replaced by the path to the folder containing the downloaded environment file. In the
109-
example earlier, this was `C:/Users/yourusername/Documents`, but make sure you use your specific folder (as seen in File Explorer).
129+
__!__ You can safely ignore the warning `FutureWarning: 'remote_definition'...`.
110130

111-
Respond with *Yes* by typing `y` when asked. Output will be printed and if no error occurs, you should have the environment configured
112-
with all packages installed.
131+
Respond with *Yes* by typing `y` when asked. Output will be printed and if no error occurs, you should have the environment configured with all packages installed.
113132

114-
**Note:** If you did use Miniconda instead, create the environment using the same commands/instructions in the terminal (make sure to
115-
do the `conda config ...` steps.).
116-
117-
When finished, keep the terminal window open (or reopen it). Execute the following commands to check your installation:
133+
When finished, keep the terminal window (or "Miniforge Prompt") open (or reopen it). Execute the following commands to check your installation:
118134

119135
```
120136
conda activate DS-geospatial
@@ -130,34 +146,13 @@ import matplotlib
130146

131147
If no message is returned, you're all set! If a message (probably an error) returned, contact the instructors. Copy paste the message returned.
132148

133-
134-
## 2. (_first day of the course_) Getting the course materials
135-
136-
### Option 1: You are a git user
137-
138-
As the course has been setup as a [git](https://git-scm.com/) repository managed on [Github](https://github.com/jorisvandenbossche/DS-python-geospatial),
139-
you can clone the entire course to your local machine. Use the command line to clone the repository and go into the course folder:
149+
To get out of the Python session, type:
140150

141151
```
142-
git clone https://github.com/jorisvandenbossche/DS-python-geospatial.git
143-
cd DS-python-geospatial
152+
quit
144153
```
145154

146-
In case you would prefer using Github Desktop,
147-
see [this tutorial](https://help.github.com/desktop/guides/contributing-to-projects/cloning-a-repository-from-github-to-github-desktop/).
148-
149-
### Option 2: You are not a git user
150-
151-
To download the repository to your local machine as a zip-file, click the `download ZIP` on the
152-
repository page <https://github.com/jorisvandenbossche/DS-python-geospatial> (green button "Code"):
153-
154-
![Download button](./static/img/download-button.png)
155-
156-
After the download, unzip on the location you prefer within your user account (e.g. `My Documents`, not `C:\`).
157-
158-
__Note:__ Make sure you know where you stored the course material, e.g. `C:/Users/yourusername/Documents/DS-python-geospatial`
159-
160-
## 3. (_first day of the course_) Test your configuration
155+
## 3. Test your configuration
161156

162157
To check if your packages are properly installed, open the Conda Terminal again (see above) and navigate to the course directory:
163158

@@ -185,12 +180,14 @@ When all checkmarks are ok, you're ready to go!
185180

186181
## 4.(_start of day during course_) Starting Jupyter Notebook with Jupyter Lab
187182

188-
Each of the course modules is set up as a [Jupyter notebook](http://jupyter.org/), an interactive environment to write and run code. It is
189-
no problem if you never used jupyter notebooks before as an introduction to notebooks is part of the course.
183+
Each of the course modules is set up as a [Jupyter notebook](http://jupyter.org/), an interactive environment to write and run code. It is no problem if you never used jupyter notebooks before as an introduction to notebooks is part of the course.
190184

191-
### Option 1: Using the command line
192185

193-
* In the terminal, navigate to the `DS-python-geospatial` directory (downloaded or cloned in the previous section)
186+
* In the terminal (or "Miniforge Prompt"), navigate to the `DS-python-geospatial` directory (downloaded or cloned in the previous section)
187+
188+
```
189+
cd FOLDER_PATH_TO_COURSE_MATERIAL
190+
```
194191

195192
* Ensure that the correct environment is activated.
196193

@@ -204,14 +201,6 @@ no problem if you never used jupyter notebooks before as an introduction to note
204201
jupyter lab
205202
```
206203

207-
### Option 2: Using Anaconda Navigator
208-
209-
In the Anaconda Navigator *Home* tab, first switch to the course environment, called `DS-geospatial` in the selection bar. Next,
210-
select the Launch button under the Jupyter Lab icon:
211-
212-
![Navigator terminal](./static/img/navigator_notebook.png)
213-
214204
## Next?
215205

216-
This will open a browser window automatically. Navigate to the course directory (if not already there) and choose the `notebooks` folder to
217-
access the individual notebooks containing the course material.
206+
This will open a browser window automatically. Navigate to the course directory (if not already there) and choose the `notebooks` folder to access the individual notebooks containing the course material.

docs/slides.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Python for GIS and Geoscience
1414

1515
Doctoral schools of Ghent University<br>
16-
September 20-22, 2023
16+
December 12, 16 and 19, 2024
1717

1818
Joris Van den Bossche, Stijn Van Hoey
1919

@@ -227,7 +227,7 @@
227227

228228
![:scale 100%](http://esq.h-cdn.co/assets/15/51/980x490/landscape-1450137389-john-cleese.JPG)
229229

230-
### https://forms.gle/j8zYZkUL9J5rfSrw8
230+
### https://forms.gle/trjSSDhzD656j63LA
231231

232232
Please fill in the questionnaire.
233233

@@ -402,4 +402,4 @@
402402
var slideshow = remark.create();
403403
</script>
404404
</body>
405-
</html>
405+
</html>

0 commit comments

Comments
 (0)