You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get started, you should have the following three elements setup:
8
8
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`
11
11
3. Test your configuration and installation
12
12
4. Start Jupyter lab
13
13
14
14
In the following sections, more details are provided for each of these steps. When all three are done, you are ready to start coding!
15
15
16
-
## 1. (_before the course_) Install Python and the required Python packages
16
+
## 1. Getting the course materials
17
17
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
21
19
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:
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.
42
39
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`.
## 2. Install Python and the required Python packages using `conda`
47
43
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).
49
49
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`
54
51
55
-
###Setup after Anaconda installation
52
+
#### Option 1: I do not have `conda` installed
56
53
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.
60
87
61
88
The packages used in the course are enlisted in
62
89
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
66
93
channels:
67
94
- conda-forge
68
95
dependencies:
69
-
- python=3.11
96
+
- python=3.12
70
97
- geopandas
71
98
- ...
72
99
```
@@ -76,45 +103,34 @@ The file contains information on:
76
103
-`channels` to define where to download the packages from
77
104
-`dependencies` contains each of the packages
78
105
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.
82
108
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:
85
110
86
-

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):
87
114
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
+
```
91
118
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):
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`)
107
128
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'...`.
110
130
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.
113
132
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:
118
134
119
135
```
120
136
conda activate DS-geospatial
@@ -130,34 +146,13 @@ import matplotlib
130
146
131
147
If no message is returned, you're all set! If a message (probably an error) returned, contact the instructors. Copy paste the message returned.
132
148
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:
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
161
156
162
157
To check if your packages are properly installed, open the Conda Terminal again (see above) and navigate to the course directory:
163
158
@@ -185,12 +180,14 @@ When all checkmarks are ok, you're ready to go!
185
180
186
181
## 4.(_start of day during course_) Starting Jupyter Notebook with Jupyter Lab
187
182
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.
190
184
191
-
### Option 1: Using the command line
192
185
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
+
```
194
191
195
192
* Ensure that the correct environment is activated.
196
193
@@ -204,14 +201,6 @@ no problem if you never used jupyter notebooks before as an introduction to note
204
201
jupyter lab
205
202
```
206
203
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:
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.
0 commit comments