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
1. Open [https://www.anaconda.com/download][anaconda-windows] with your web browser.
42
+
### Linux / MacOS
47
43
48
-
2. Download the Anaconda for Windows installer with Python 3.
49
-
50
-
3. Install Python 3 by running the Anaconda Installer, using all of the defaults for installation *except* make sure that:
51
-
***Register Anaconda as my default Python 3.x** option is checked (it should be in the latest version of Anaconda).
52
-
***Add Anaconda to my PATH environment variable** is selected.
53
-
54
-
55
-
:::::::::::::::::::::::::
56
-
57
-
:::::::::::::::: solution
44
+
Open a terminal and install `uv` following the [official installation instructions](https://docs.astral.sh/uv/getting-started/installation/):
58
45
59
-
### Mac OS
46
+
```sh
47
+
curl -LsSf https://astral.sh/uv/install.sh | sh
48
+
```
60
49
61
-
[Video tutorial][video-mac]
50
+
Then make sure you are inside the `geospatial-python` directory you created during the data setup step. If not, please do:
62
51
63
-
1. Open [https://www.anaconda.com/download][anaconda-mac] with your web browser.
52
+
```sh
53
+
cd<path-to-geospatial-python>
54
+
```
64
55
65
-
2. Download the Anaconda installer with Python 3 for OS X. These instructions assume that you use the "Graphical Installer" `.pkg` file
56
+
Finally, run the following command to create a virtual environment and install the required dependencies:
66
57
67
-
3. Follow the Python 3 installation instructions. Make sure that the install location is set to **Install only for me** so Anaconda will install its files locally, relative to your home directory. Installing the software for all users tends to create problems in the long run and should be avoided.
Note that the following installation steps require you to work from the shell.
77
-
If you run into any difficulties, please request help before the workshop begins.
78
-
79
-
1. Open [https://www.anaconda.com/download][anaconda-linux] with your web browser.
80
-
81
-
2. Download the Anaconda installer with Python 3 for Linux.
67
+
### Windows
82
68
83
-
3. Open a terminal window and navigate to the directory where the executable is downloaded (e.g., `cd ~/Downloads`).
69
+
On Windows, first we install `uv` using PowerShell following the [official installation instructions](https://docs.astral.sh/uv/getting-started/installation/):
Sometimes after the installation, you may see suggestions powershell terminal like `$env:Path = "C:\Users\username\.local\bin;$env:Path"` This means you need to manually add the `uv` executable to your system's PATH variable. Please run the suggested command in your PowerShell terminal to add `uv` to your PATH. Otherswise PowerShell will not recognize the `uv` command in the next step.
90
76
91
-
and press "Tab" to autocomplete the full file name. The name of file you just downloaded should appear.
77
+
Then make sure you are inside the `geospatial-python` directory you created during the data setup step. If not, please do:
92
78
93
-
5. Press "Enter" (or "Return" depending on your keyboard).
79
+
```powershell
80
+
cd <path-to-geospatial-python>
81
+
```
94
82
95
-
6. Follow the text-only prompts. When the license agreement appears (a colon will be present at the bottom of the screen) press "Spacebar" until you see the bottom of the text. Type `yes`and press "Enter" to approve the license. Press "Enter" again to approve the default location for the files. Type `yes` and press "Enter" to prepend Anaconda to your `PATH` (this makes the Anaconda distribution your user's default Python).
83
+
Finally, run the following command to create a virtual environment and install the required dependencies:
After the installation, a `.venv` directory will be created in the current directory, which contains the virtual environment with all the required dependencies.
101
92
102
-
### Setting up the workshop environment
103
-
104
-
If Anaconda was properly installed, you should have access to the `conda`
105
-
command in your terminal (use the **Anaconda prompt** on **Windows**).
106
-
107
-
1. Test that `conda` is correctly installed by typing:
108
-
109
-
```bash
110
-
conda --version
111
-
```
93
+
### Testing the installation
112
94
113
-
which should print the version of conda that is currently installed, e.g. :
95
+
In order to follow the lesson, you should launch JupyterLab. Let's try it now to make sure everything is set up correctly. You can run the following command in your terminal from the `geospatial-python` directory:
114
96
115
-
```output
116
-
conda 22.9.0
117
-
```
118
-
119
-
2. Run the following command:
120
-
121
-
```bash
122
-
conda install -c conda-forge mamba
123
-
```
124
-
125
-
IMPORTANT: If your terminal responds to the above command with `conda: command not found` see the [Troubleshooting section](#troubleshooting-conda-command-not-found).
126
-
127
-
3. Create the Python environment for the workshop by running:
IMPORTANT: If you close the terminal, you will need to reactivate this
165
-
environment with `conda activate geospatial` to use the Python libraries
166
-
required for the lesson and to start JupyterLab, which is also installed in the
167
-
`geospatial` environment.
168
-
169
-
### Starting JupyterLab
170
-
171
-
In order to follow the lesson, you should launch JupyterLab. After activating the
172
-
geospatial conda environment, enter the following command in your terminal (use the **Anaconda prompt** on **Windows**):
173
-
174
-
```bash
175
-
jupyter lab
98
+
uv run jupyter lab
176
99
```
177
100
178
101
Once you have launched JupyterLab, create a new Python 3 notebook, type the following code snippet in a cell and press the "Play" button:
@@ -183,42 +106,11 @@ import rioxarray
183
106
184
107
If all the steps above completed successfully you are ready to follow along with the lesson!
185
108
186
-
### Troubleshooting `conda: command not found`
187
-
188
-
***Mac OS and Linux users:**
189
-
190
-
1. First, find out where Anaconda is installed.
191
-
192
-
The typical install location is in your `$HOME` directory (i.e., `/Users/your-username/`) so use `ls ~` to check whether an `anaconda3` directory is present in your home directory:
193
-
194
-
```bash
195
-
ls ~
196
-
```
197
-
198
-
```output
199
-
Applications Downloads Pictures
200
-
anaconda3 Library Public
201
-
Desktop Movies
202
-
Documents Music
203
-
```
204
-
205
-
If, like above, you see a directory called `anaconda3`in the output we're in good shape. If not, **contact the instructor for help**.
206
-
207
-
2. Activate the `conda` command-line program by entering the following command:
208
-
209
-
```bash
210
-
source ~/anaconda3/bin/activate
211
-
```
212
-
If all goes well, nothing will print to the terminal and your prompt will now have `(base)` floating around somewhere
213
-
on the left. This is an indication that you are in the base Anaconda environment.
109
+
::: callout
214
110
215
-
Continue from the beginning of step 3 to complete the creation of the `geospatial` virtual environment.
111
+
### Alternative: software setup using Anaconda
216
112
113
+
If you prefer to use Anaconda, you can follow the alternative setup instructions on [this
0 commit comments