Conda is an open-source package manager and environment management system that runs on Windows, macOS, and Linux. Miniconda is a minimal version of Conda that includes only Conda and its dependencies. This tool allows you to create isolated environments to manage different versions of packages and software dependencies without conflicts.
To install Conda on Linux, follow these steps:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
source ~/.bashrc
Conda environments allow you to create and manage different development environments. Here are some essential commands:
conda create --name my_environment
conda activate my_environment
conda deactivate
conda env list
conda remove --name my_environment --all
Conda contains a package manager that simplifies package installation and management. **N.B.** Conda is compatible with pip, so you can use both package managers depending on your needs.
pip
is out of the scope of this guide. If you want to know more about it, check the official documentation.
The following are some common Conda package management commands:
conda install package_name
conda update package_name
conda remove package_name
conda list
conda search package_name
Below is an example of how to create a Conda environment, activate it, and install packages using pip:
example_environment
with Python 3.10:
conda create --name example_environment python=3.10
conda activate example_environment
The terminal prompt should change to:
(example_environment) user@hostname:~$
pip install numpy pandas
python -c "import numpy; import pandas; print('Numpy and Pandas installed correctly')"
conda deactivate
Here are some useful Conda commands for various operations:
conda info
conda list --export > package_list.txt
conda create --name my_environment --file package_list.txt