Skip to content

Commit b7a9cb7

Browse files
authored
Installing anaconda Instruction (#600)
2 parents 5709674 + dd875ad commit b7a9cb7

File tree

8 files changed

+127
-58
lines changed

8 files changed

+127
-58
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# What is Conda and why do you need it?
2+
3+
Have you ever experienced the frustration when you have multiple Python package conflicts and needs to resolve multiple package dependency issues before you can actually work on a new project? If that's the case, **Conda** is here to save your day!
4+
5+
Conda is an open-source package management and environment management system that can be used to simplify a lot of the operations regarding environment management.
6+
7+
This tutorial will focus on using Conda to setup multiple Python environments that can be used for different projects. So that you'll never have to worry about setting up an environment and running into issues again!
8+
9+
# Difference between Anaconda and Miniconda?
10+
11+
As of the time writing, Conda's official website is this: [https://docs.conda.io/en/latest/#](https://docs.conda.io/en/latest/#)
12+
13+
It provides a simple installation method and some general documentation for the usage of Conda.
14+
15+
However, a quick Google search might tell you that, there's actually two different versions of Conda, one being **Anaconda** and another being **Miniconda**.
16+
17+
The major difference between **Miniconda** and **Anaconda** is that:
18+
19+
- Anaconda supports Graphical User Interface (GUI), so you can actually click on things to make it work.
20+
- Miniconda does not support GUI and is used mainly on the "shell" (e.g. zsh, bash, sh, powershell, etc.) of your system. If you do not know what a "shell" is, this tutorial might be a little bit advanced.
21+
22+
With all that being said, this tutorial focuses on using Miniconda to setup Conda and multiple Python environments, so you might need to look for another tutorial if you plan to use Anaconda.
23+
24+
# Why do you want to use Conda instead of other environment management solutions?
25+
26+
Other environment management solutions for Python specifically, includes `pipenv` and `virtualenv`, also support similar functionalities to Conda.
27+
28+
Each of these solutions all have their own unique strengths and weaknesses, the following is a table that gives an overview to their own capabilities and flaws:
29+
30+
| Feature | Conda | Pipenv | Virtualenv |
31+
|---------|-------|--------|------------|
32+
| **Cross-Language Support** | Supports multiple languages | Python only | Python only |
33+
| **Environment Management** | Comprehensive environment management | Automates virtual environment management | Isolates Python environments |
34+
| **Package Management** | Manages Python and non-Python packages | Manages Python packages, with `Pipfile.lock` for deterministic builds | Only isolates environments, does not manage packages |
35+
| **Repository** | Large repository (Anaconda Repository) | Uses PyPI | Uses PyPI |
36+
| **Platform Support** | Cross-platform (Windows, macOS, Linux) | Cross-platform | Cross-platform |
37+
| **Simplicity and Intuitiveness** | Can be complex due to additional features | Simpler syntax and intuitive usage | Minimalistic and lightweight |
38+
| **Performance** | Can be slower, especially for large distributions | Can have performance issues with large dependencies | Fast and efficient |
39+
| **Scope** | Suitable for complex, multi-language projects | Ideal for Python-specific development | Focused on Python-only projects |
40+
| **Ease of Setup** | Requires more setup compared to pip | Simplifies setup with automation | Quick and easy setup |
41+
42+
# How do you use Conda?
43+
44+
To actually use Conda, we need to follow the following [general steps](./Setup_Conda.md) to set up

Topics/Development_Process/Conda/Setup_Conda.md

Lines changed: 83 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,18 @@
1-
## What is Conda and why do you need it?
2-
3-
Have you ever experienced the frustration when you have multiple Python package conflicts and needs to resolve multiple package dependency issues before you can actually work on a new project? If that's the case, **Conda** is here to save your day!
4-
5-
Conda is an open-source package management and environment management system that can be used to simplify a lot of the operations regarding environment management.
6-
7-
This tutorial will focus on using Conda to setup multiple Python environments that can be used for different projects. So that you'll never have to worry about setting up an environment and running into issues again!
8-
9-
## Difference between Anaconda and Miniconda?
10-
11-
As of the time writing, Conda's official website is this: [https://docs.conda.io/en/latest/#](https://docs.conda.io/en/latest/#)
12-
13-
It provides a simple installation method and some general documentation for the usage of Conda.
14-
15-
However, a quick Google search might tell you that, there's actually two different versions of Conda, one being **Anaconda** and another being **Miniconda**.
16-
17-
The major difference between **Miniconda** and **Anaconda** is that:
18-
19-
- Anaconda supports Graphical User Interface (GUI), so you can actually click on things to make it work.
20-
- Miniconda does not support GUI and is used mainly on the "shell" (e.g. zsh, bash, sh, powershell, etc.) of your system. If you do not know what a "shell" is, this tutorial might be a little bit advanced.
21-
22-
With all that being said, this tutorial focuses on using Miniconda to setup Conda and multiple Python environments, so you might need to look for another tutorial if you plan to use Anaconda.
23-
24-
## Why do you want to use Conda instead of other environment management solutions?
25-
26-
Other environment management solutions for Python specifically, includes `pipenv` and `virtualenv`, also support similar functionalities to Conda.
27-
28-
Each of these solutions all have their own unique strengths and weaknesses, the following is a table that gives an overview to their own capabilities and flaws:
29-
30-
| Feature | Conda | Pipenv | Virtualenv |
31-
|---------|-------|--------|------------|
32-
| **Cross-Language Support** | Supports multiple languages | Python only | Python only |
33-
| **Environment Management** | Comprehensive environment management | Automates virtual environment management | Isolates Python environments |
34-
| **Package Management** | Manages Python and non-Python packages | Manages Python packages, with `Pipfile.lock` for deterministic builds | Only isolates environments, does not manage packages |
35-
| **Repository** | Large repository (Anaconda Repository) | Uses PyPI | Uses PyPI |
36-
| **Platform Support** | Cross-platform (Windows, macOS, Linux) | Cross-platform | Cross-platform |
37-
| **Simplicity and Intuitiveness** | Can be complex due to additional features | Simpler syntax and intuitive usage | Minimalistic and lightweight |
38-
| **Performance** | Can be slower, especially for large distributions | Can have performance issues with large dependencies | Fast and efficient |
39-
| **Scope** | Suitable for complex, multi-language projects | Ideal for Python-specific development | Focused on Python-only projects |
40-
| **Ease of Setup** | Requires more setup compared to pip | Simplifies setup with automation | Quick and easy setup |
41-
42-
43-
## How do you use Conda?
44-
45-
To actually use Conda, we need to follow the following general steps
46-
47-
### Installation (Miniconda)
1+
# Table of Contents
2+
1. [Miniconda](#Installation-Miniconda)
3+
- [Miniconda Installation](#Installation-Miniconda)
4+
- [Setup MacOS for Miniconda](#Setup-MacOS-for-Miniconda)
5+
- [Setup Windows for Miniconda](#Setup-Windows-for-Miniconda)
6+
2. [Anaconda](#Installation-anaconda)
7+
- [Anaconda Installation](#Installation_anaconda)
8+
- [Setup MacOS for Anaconda](#Setup-MacOS-for-Anaconda)
9+
- [Setup Windows for Miniconda](#Setup-Windows-for-anaconda)
10+
3. [Creating Environments](#Creating-Environments-Python)
11+
4. [Switching Environments](#Switching-Environments-Python)
12+
5. [Removing Environments](#Removing-Environments-Python)
13+
6. [External Resources](#External-Learning-Resources-for-Conda)
14+
15+
# Installation (Miniconda)
4816

4917
With a little bit of navigation, we see that there are download links here: [https://docs.conda.io/projects/miniconda/en/latest/](https://docs.conda.io/projects/miniconda/en/latest/)
5018

@@ -58,9 +26,9 @@ In the picture shown above, download the one that fits your system, in my case,
5826

5927
Then just download and click through the install process until you have completed.
6028

61-
The setup guide for **MacOS** is [here](#setup-macos), for **Windows** is [here](#setup-windows)
29+
The setup guide for **MacOS** is [here](#setup-macos-for-miniconda), for **Windows** is [here](#setup-windows-for-miniconda)
6230

63-
### Setup [MacOS]
31+
## Setup [MacOS] for Miniconda
6432

6533
Regarding the setup process for Miniconda, multiple different situations can arise.
6634

@@ -80,7 +48,7 @@ One of the common fixes for this is to call `conda init [shell_type]`. For examp
8048

8149
With all that being said, we can finally start to unleash the power of Conda. [Hyperlink here](#creating-environments-python)
8250

83-
### Setup [Windows]
51+
## Setup [Windows] for Miniconda
8452

8553
> Guide Reference: https://gist.github.com/martinsotir/2bd2e16332dff71e0fa5be3ed3468a6c
8654
@@ -118,21 +86,82 @@ In this prompt, type in `conda init powershell`, and press enter. It should show
11886

11987
After all of these, you should be able to just start up a new `powershell` session, and it should have miniconda installed! With this, you can start to unleash the power of Conda and proceed to the next section!
12088

121-
### Creating Environments (Python)
89+
## Installation (Anaconda)
90+
91+
You can find the Anaconda installer and detailed installation instructions on their official download page: [https://www.anaconda.com/products/individual](https://www.anaconda.com/download#downloads)
92+
93+
The initial step involves downloading the appropriate installer for your operating system. If you're working on a system without a GUI, you might prefer to use command-line installation methods, which are also detailed on the Anaconda website.
94+
95+
![anaconda download page](anaconda_download.png)
96+
97+
In the screenshot above, select the installer that matches your system. For instance, if you are using a macOS with an M1 chip, you might choose the `Anaconda macOS Apple M1 64-bit pkg`.
98+
99+
Download the installer and follow the prompts to complete the installation process. Make sure you add conda to the environment path during installation
100+
101+
Here is an example of how the MacOS anaconda installer looks like:
102+
![anaconda installer example](anaconda_installer.png)
103+
104+
Setup guides for different operating systems can be found through the following links: for **MacOS** [here](#setup-macos-for-Anaconda), and for **Windows**, please follow the same procedure as MacOS, but choose the `64-Bit Graphical Installer (904.4M)` package.
105+
106+
## Setup [MacOS] for Anaconda
107+
108+
The setup process for Anaconda can vary based on your operating system and shell configuration.
109+
110+
To verify if Anaconda has been installed successfully, open your system's shell. For macOS users, the default shell is typically `zsh`. You can open `zsh` by pressing "Command + Space", typing `terminal`, and selecting the first result.
111+
112+
In the terminal window, run the following to display the version of Anaconda installed on your system.
113+
```
114+
conda list anaconda
115+
```
116+
![verifying anaconda installation](anaconda_verify.png)
117+
118+
If a list of anaconda version appears, it indicates that Anaconda is installed correctly, and you can proceed to [Creating Environments (Python)](#creating-environments-python).
119+
120+
Should you encounter any issues where Anaconda commands are not recognized, one common fix is to initialize Anaconda for your shell. This process can be completed by running `conda init [shell_type]`. If you're using macOS, guidance for this step is provided [here](https://docs.conda.io/projects/conda/en/latest/user-guide/install/macos.html).
121+
122+
![anaconda init pic](anaconda_init.png)
123+
124+
With Anaconda successfully installed and initialized, you're ready to explore its robust features. You can use the GUI of anaconda or command line.
125+
![anaconda gui](anaconda_gui.png)
126+
In this doc, we will only talk about creating Python environments using command line](#creating-environments-python). If you need help with GUI, you can check out the official documentation [here](https://docs.anaconda.com/free/navigator/?utm_source=anaconda_navigator&utm_medium=nav-docs).
127+
128+
## Setup [Windows] for Anaconda
129+
130+
The installation and setup process for Anaconda on Windows varies slightly from macOS, but it's designed to be straightforward. Ensuring that Anaconda is added to the PATH during installation is crucial for seamless use of the command line interface.
131+
132+
To verify if Anaconda has been successfully installed on your Windows system, you'll use the Command Prompt or PowerShell. You can open either of these applications by searching for them in the Start menu.
133+
134+
In the Command Prompt or PowerShell, enter the following command to display the version of Anaconda installed on your system.
135+
```
136+
conda list anaconda
137+
```
138+
If you see a list of packages with "anaconda" in their names, it signifies that Anaconda has been installed correctly, and you can move on to [Creating Environments (Python)](#creating-environments-python).
139+
140+
If the `conda` command is not recognized, you might need to add Anaconda to your system's PATH manually or run the initialization command for your shell. This can often be resolved by launching Anaconda Navigator and allowing it to set up everything for you, or by executing the initialization command:
141+
142+
After running this, you may need to restart your Command Prompt or PowerShell to ensure the changes take effect.
143+
144+
This step ensures that the `conda` command is available system-wide, allowing you to manage your Anaconda installation and environments directly from your Command Prompt or PowerShell.
145+
146+
For those who prefer graphical interfaces, Anaconda also provides a GUI called Anaconda Navigator, which can be launched from the Start menu. The official documentation offers comprehensive guides on both command-line and GUI methods for managing your environments and packages. For this document, we'll focus on command-line operations. For GUI assistance, refer to the [official documentation](https://docs.anaconda.com/navigator/).
147+
148+
With Anaconda properly installed and initialized, you're all set to take advantage of its powerful package and environment management capabilities to streamline your Python projects.
149+
150+
# Creating Environments (Python)
122151

123152
Environments in Conda are like separated files in different directories. For example, if you have a Conda environment specifically for Machine Learning projects, when you switch to another software engineering project, you probably want to not use the Machine Learning packages so that they don't interfere with what you're trying to do.
124153

125154
To do this, open up your shell and type in `conda create -n <name> python=<version>`, where `<name>` is the name of the environment you are creating, and `<version>` is the Python version you want. If you are creating an environment that is not Python, you can also drop the parameter, so that you create an environment with just `conda create -n <name>`.
126155

127156
In my case, I will create a Python environment with Python 3.11, called "TEST", as shown in the picture below.
128157

129-
![create environment](conda_create_env.png)
158+
![create environment](anaconda_create_env.png)
130159

131160
What I called here is `conda create -n TEST python=3.11`, and pressed enter. Then, it will ask if you will confirm or not, just type "Y" to confirm and enter.
132161

133162
Then, you should be able to switch to your new environment that you just created!
134163

135-
### Switching Environments (Python)
164+
# Switching Environments (Python)
136165

137166
After you have followed the steps above to create multiple environments, you can switch between them easily.
138167

@@ -158,7 +187,7 @@ If you want to be more in-depth (working with IDEs), you should be able to find
158187

159188
![conda directories](interpreter.png)
160189

161-
### Removing Environments (Python)
190+
# Removing Environments (Python)
162191

163192
After you're done with a specific environment and the project, you can release the environment by calling `conda remove --name <NAME> --all`.
164193

@@ -172,10 +201,6 @@ After everything is done, you should not be able to find the environment named "
172201

173202
![conda list env](conda_env_list.png)
174203

175-
## External Sources
176-
177-
The following are a list of references that you can check out if you are planning to learn more about Conda!
178-
179204
# External Learning Resources for Conda
180205

181206
1. [**Conda Official Documentation**](https://docs.conda.io/en/latest/): This is the primary source of information about Conda, covering installation, commands, package management, and environment management.
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)