-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathinstall-conda.Rmd
More file actions
232 lines (160 loc) · 8.91 KB
/
install-conda.Rmd
File metadata and controls
232 lines (160 loc) · 8.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
---
title: "Conda Installation Guide"
subtitle: "A Step-by-step guide for conda installation and configuration."
fontsize: 12pt
output:
html_document:
df_print: paged
toc: yes
toc_depth: 2
highlight: pygments
includes:
in_header: copy-code.html
after_body: comment.html
# pdf_document:
# toc: yes
# toc_depth: 3
# word_document:
# toc: yes
# toc_depth: '3'
header-includes:
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \renewcommand{\footrulewidth}{0.4pt}
- \fancyhead[LE,RO]{\thepage}
- \geometry{left=1in,top=0.75in,bottom=0.75in}
- \fancyfoot[CE,CO]{{\includegraphics[height=0.5cm]{images/cc-by-nc.png}} Ujaval Gandhi http://www.spatialthoughts.com}
classoption: a4paper
---
## Why Conda?
Conda is an easy and reliable way to get a Python installation with all required packages and dependencies for your project. Conda provides the `conda` command that is used to install various Python packages and create isolated environments for different projects. Conda is cross-platform (Windows, Mac, Linux) and works across many different system configurations. We use conda for setting up your Python environments for all our courses.
> Use of Conda by large commercial companies may require a license. For more details and alternatives, read our [Frequently Asked Questions (FAQs)](#faqs).
## Anaconda Distribution vs Miniconda
Anaconda offers multiple installers.
* *Anaconda Distribution*: This is a large installer that comes with many pre-install packages and a graphical program to manage them.
* *Miniconda*: A light-weight and minimal installer that comes give you a command-line interface via the `conda` command.
**Miniconda** is the preferred installation option for all our course participants.
## Install Miniconda on Windows
1. Visit the [Miniconda Download](https://www.anaconda.com/download/success) page and then select the `Windows 64-Bit Graphical Installer` under Miniconda. It will download an `.exe` file.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_windows1.png')
```
2. Once downloaded, run the installer by double-clicking it. Click *Next*.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_windows2.png')
```
3. Read the terms of conditions and click *I Agree* to accept them.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_windows3.png')
```
4. Select *Just Me (recommended)* option for installation and click *Next*.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_windows4.png')
```
5. For *Choose Install Location*, you can keep the the default suggested directory as the *Destination Folder*. Click *Next*
> Note: If your username has spaces, or non-English characters, it can causes problems with some packages. In that case, you can install it to a path such as `C:\miniconda3`.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_windows5.png')
```
6. Confirm the *Advanced Installation Options* and click *Install*.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_windows6.png')
```
7. Once the installation finishes, click *Finish* to exit the installer.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_windows7.png')
```
8. Your installation is complete, but we need to verify it and configure a few settings. Open a new *Anaconda Powershell Prompt* from the Start Menu.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_windows8.png')
```
9. A new *Anaconda Powershell Prompt* window will open and display your `base` environment activated by default. Enter the following command which will initialize and configure conda to work with Powershell.
```bash
conda init powershell
```
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_windows9.png')
```
10. Finally, run the following command to accept the Anaconda [Terms of Service (ToS)](https://www.anaconda.com/legal).
```bash
conda tos accept
```
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_windows10.png')
```
Your setup is now complete.
## Install Miniconda on Mac
1. Visit the [Miniconda Download](https://www.anaconda.com/download/success) page and then select the `64-bit (Apple silicon) Graphical Installer` under Miniconda. It will download a `.pkg` installer.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_mac1.png')
```
2. Once downloaded, run the installer by double-clicking it. Click *Continue*.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_mac2.png')
```
3. Read the terms of conditions and click *Agree* to accept them.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_mac3.png')
```
4. Confirm the install location and click *Continue*.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_mac4.png')
```
5. Wait for the installer to finish and then click *Close*.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_mac5.png')
```
6. Open a new *Terminal* window. If your installation was successful, the terminal will start without any errors and will display your `base` environment activated by default.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_mac6.png')
```
7. Run the following command to accept the Anaconda [Terms of Service (ToS)](https://www.anaconda.com/legal).
```bash
conda tos accept
```
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_mac7.png')
```
Your setup is now complete.
## Install Miniconda on Linux
1. Visit the [Miniconda Download](https://www.anaconda.com/download/success) page and then download the appropriate Linux installer under Miniconda. Choose the `64-Bit (x86) Installer` for Intel based systems and `64-Bit (AWS Graviton2 / ARM64) Installer` for systems with ARM processors.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_linux1.png')
```
2. Open a Terminal and `cd` to the directory containing the downloaded file. Run the following command to start the installer. Pick the command for the installer you have downloaded.
```bash
bash ~/Miniconda3-latest-Linux-x86_64.sh
```
```bash
bash ~/Miniconda3-latest-Linux-aarch64.sh
```
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_linux2.png')
```
3. Read the terms of conditions and type `yes` to accept them.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_linux3.png')
```
4. Confirm the install location and press *Enter*.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_linux4.png')
```
5. Wait for the installer to finish and when prompted to *Proceed with initialization?*, enter `yes`.
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_linux5.png')
```
6. Restart the Terminal for the changes to take effect. The terminal will now display your `base` environment activated by default. Run the following command to accept the Anaconda [Terms of Service (ToS)](https://www.anaconda.com/legal).
```bash
conda tos accept
```
```{r echo=FALSE, fig.align='center', out.width='75%'}
knitr::include_graphics('images/common/miniconda_linux6.png')
```
Your setup is now complete.
## FAQs
### Is Conda free?
Anaconda's [Terms of Service](https://www.anaconda.com/legal/terms/terms-of-service) requires commercial entities with more than 200 employees purchase a license. Python ecosystem has many other package managers that are offered under more liberal licensing terms. Once you learn the basics of creating environments and installing packages using conda, you may consider switching to any of the following alternatives.
* [Mamba](https://mamba.readthedocs.io/en/latest/index.html) is an alternate open-source package manager that is fully compatible with conda and does not have the commercial licensing requirements of conda.
* [Pixi](https://pixi.prefix.dev/latest/) is a fast and modern alternative to conda.
### Can I use UV?
Working with Geospatial Python requires installing binary packages such as *GDAL* - which are not supported by pure Python package managers like `pip` or `uv`. You can read more about [Python package managers](https://jacobtomlinson.dev/posts/2025/python-package-managers-uv-vs-pixi/) which details all the options and their tradeoffs.