@@ -6,7 +6,7 @@ title: Setup
6
6
## Setting up your Lesson Directory and Getting the Data
7
7
8
8
1 . Open the terminal/shell:
9
- * On ** Windows** , open ** Git Bash** .
9
+ * On ** Windows** , open ** Git Bash** .
10
10
* On ** Mac OS** or ** Linux** , open the ** Terminal** app.
11
11
12
12
2 . Change your working directory to your ** Desktop** :
@@ -60,8 +60,8 @@ individually can be a bit difficult, however, so we recommend the all-in-one
60
60
installer [Anaconda][anaconda].
61
61
62
62
Regardless of how you choose to install it, please make sure you install Python
63
- version 3.x (e.g., 3.7 is fine). Also, please set up your python environment at
64
- least a day in advance of the workshop. If you encounter problems with the
63
+ version 3.x (e.g., 3.7 is fine). Also, please set up your python environment at
64
+ least a day in advance of the workshop. If you encounter problems with the
65
65
installation procedure, ask your workshop organizers via e-mail for assistance so
66
66
you are ready to go as soon as the workshop begins.
67
67
@@ -87,7 +87,7 @@ you are ready to go as soon as the workshop begins.
87
87
88
88
# ## Linux
89
89
90
- Note that the following installation steps require you to work from the shell.
90
+ Note that the following installation steps require you to work from the shell.
91
91
If you run into any difficulties, please request help before the workshop begins.
92
92
93
93
1. Open [https://www.anaconda.com/distribution/][anaconda-linux] with your web browser.
@@ -112,20 +112,20 @@ If you run into any difficulties, please request help before the workshop begins
112
112
d. Press enter.
113
113
114
114
e. Follow the text-only prompts. When the license agreement appears (a colon
115
- will be present at the bottom of the screen) press the space bar until you see the
116
- bottom of the text. Type ` yes` and press enter to approve the license. Press
117
- enter again to approve the default location for the files. Type ` yes` and
118
- press enter to prepend Anaconda to your ` PATH` (this makes the Anaconda
115
+ will be present at the bottom of the screen) press the space bar until you see the
116
+ bottom of the text. Type ` yes` and press enter to approve the license. Press
117
+ enter again to approve the default location for the files. Type ` yes` and
118
+ press enter to prepend Anaconda to your ` PATH` (this makes the Anaconda
119
119
distribution your user' s default Python).
120
120
121
121
## Setting up the workshop environment with conda
122
122
123
- Once you have installed Anaconda, you should have access to the `conda` command in your terminal.
123
+ Once you have installed Anaconda, you should have access to the `conda` command in your terminal.
124
124
125
125
1. Test that this is so by running the `conda` command in the terminal. You should get an output that looks like this:
126
126
127
127
```bash
128
- → conda
128
+ → conda
129
129
usage: conda [-h] [-V] command ...
130
130
131
131
conda is a tool for managing and deploying applications, environments and packages.
@@ -168,27 +168,27 @@ Once you have installed Anaconda, you should have access to the `conda` command
168
168
169
169
2. Create the environment using the `conda create` command. It' s possible to paste the following
170
170
code on the Terminal:
171
-
171
+
172
172
` ` ` bash
173
173
conda create -n geospatial -c conda-forge -y \
174
174
jupyterlab numpy matplotlib \
175
- xarray rasterio geopandas rioxarray earthpy descartes xarray-spatial pystac-client python-graphviz
175
+ xarray rasterio geopandas rioxarray earthpy descartes xarray-spatial pystac-client==0.3.2 python-graphviz
176
176
177
177
` ` `
178
-
178
+
179
179
_Please note that this step may take several minutes to complete. If it takes more than a few minutes, see below for another method._
180
180
181
181
In this command, the ` -n` argument specifies the environment name, the ` -c` argument specifies the Conda channel
182
182
where the libraries are hosted, and the ` -y` argument spares the need for confirmation. The following arguments are
183
183
the names of the libraries we are going to use. As you can see, geospatial analysis requires many libraries!
184
184
Luckily, package managers like ` conda` facilitate the process of installing and managing them.
185
-
185
+
186
186
If the above command does not work, it' s also possible to create the environment from a file:
187
-
187
+
188
188
Right-click and "Save Link As..." on this link:
189
-
189
+
190
190
[https://carpentries-incubator.github.io/geospatial-python/files/environment.yaml](files/environment.yaml)
191
-
191
+
192
192
Name it `environment.yaml` and save it to your `geospatial-python` folder.
193
193
The `environment.yaml` contains the names of Python libraries that are required to run the lesson:
194
194
@@ -210,10 +210,10 @@ code on the Terminal:
210
210
- xarray-spatial
211
211
- earthpy
212
212
- descartes # necessary for geopandas plotting
213
- - pystac-client
213
+ - pystac-client==0.3.2 # pin version to work with earth-search STAC API
214
214
- python-graphviz
215
215
```
216
-
216
+
217
217
In the terminal, navigate to the directory where you saved the `environment.yaml` file using the `cd` command.
218
218
Then run:
219
219
@@ -222,9 +222,9 @@ code on the Terminal:
222
222
```
223
223
224
224
`conda` should begin to locate, download, and install the Python libraries listed in the `environment.yaml` file.
225
-
225
+
226
226
> ## Faster Environment Install With One Extra Step
227
- > If you see a spinning `/` for more than a few minutes, you may want to try the following to speed up the environment installation.
227
+ > If you see a spinning `/` for more than a few minutes, you may want to try the following to speed up the environment installation.
228
228
> 1. Cancel the currently running `conda create` process with CTRL+C
229
229
> 2. Run `conda install -c conda-forge mamba`
230
230
> 3. Run `mamba env create -f environment.yaml`
@@ -260,16 +260,16 @@ code on the Terminal:
260
260
` ` `
261
261
262
262
> # # IMPORTANT
263
- > If you close the terminal, you will need to
263
+ > If you close the terminal, you will need to
264
264
reactivate this environment with ` conda activate geospatial` to use the Python libraries required for the lesson and
265
265
> to start JupyterLab, which is also installed in the ` geospatial` environment.
266
266
{: .callout}
267
267
268
268
269
269
# # Starting JupyterLab
270
270
271
- In order to follow the lessons on using Python (episode 5 and onward), you should launch JupyterLab
272
- after activating the geospatial conda environment in your working directory that contains the data you downloaded.
271
+ In order to follow the lessons on using Python (episode 5 and onward), you should launch JupyterLab
272
+ after activating the geospatial conda environment in your working directory that contains the data you downloaded.
273
273
See [Starting JupyterLab][starting-jupyterlab] for guidance.
274
274
275
275
If all of the steps above completed successfully you are ready to follow along with the lesson!
@@ -290,7 +290,7 @@ If all of the steps above completed successfully you are ready to follow along w
290
290
% ls ~
291
291
> Applications Downloads Pictures
292
292
anaconda3 Library Public
293
- Desktop Movies
293
+ Desktop Movies
294
294
Documents Music
295
295
` ` `
296
296
0 commit comments