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
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 |
|**Package Management**| Manages Python and non-Python packages | Manages Python packages, with `Pipfile.lock` for deterministic builds | Only isolates environments, does not manage packages |
Copy file name to clipboardExpand all lines: Topics/Development_Process/Conda/Setup_Conda.md
+83-58Lines changed: 83 additions & 58 deletions
Original file line number
Diff line number
Diff 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 |
|**Package Management**| Manages Python and non-Python packages | Manages Python packages, with `Pipfile.lock` for deterministic builds | Only isolates environments, does not manage packages |
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/)
50
18
@@ -58,9 +26,9 @@ In the picture shown above, download the one that fits your system, in my case,
58
26
59
27
Then just download and click through the install process until you have completed.
60
28
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)
62
30
63
-
###Setup [MacOS]
31
+
## Setup [MacOS] for Miniconda
64
32
65
33
Regarding the setup process for Miniconda, multiple different situations can arise.
66
34
@@ -80,7 +48,7 @@ One of the common fixes for this is to call `conda init [shell_type]`. For examp
80
48
81
49
With all that being said, we can finally start to unleash the power of Conda. [Hyperlink here](#creating-environments-python)
@@ -118,21 +86,82 @@ In this prompt, type in `conda init powershell`, and press enter. It should show
118
86
119
87
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!
120
88
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
+

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:
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.
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
+

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
+

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)
122
151
123
152
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.
124
153
125
154
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>`.
126
155
127
156
In my case, I will create a Python environment with Python 3.11, called "TEST", as shown in the picture below.
128
157
129
-

158
+

130
159
131
160
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.
132
161
133
162
Then, you should be able to switch to your new environment that you just created!
134
163
135
-
###Switching Environments (Python)
164
+
# Switching Environments (Python)
136
165
137
166
After you have followed the steps above to create multiple environments, you can switch between them easily.
138
167
@@ -158,7 +187,7 @@ If you want to be more in-depth (working with IDEs), you should be able to find
158
187
159
188

160
189
161
-
###Removing Environments (Python)
190
+
# Removing Environments (Python)
162
191
163
192
After you're done with a specific environment and the project, you can release the environment by calling `conda remove --name <NAME> --all`.
164
193
@@ -172,10 +201,6 @@ After everything is done, you should not be able to find the environment named "
172
201
173
202

174
203
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
-
179
204
# External Learning Resources for Conda
180
205
181
206
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.
0 commit comments