Module 2 of 11 · Conda: Package Management and Environments · Beginner

Installing Conda

Duration: 5 min

This module covers the installation process of Conda, a powerful package and environment management system. Understanding how to install Conda is crucial as it allows you to create isolated environments, manage dependencies, and streamline your workflow for various Python projects.

Downloading and Installing Conda

Conda can be installed using either Miniconda or Anaconda distributions. Miniconda is a minimal installer for Conda, while Anaconda includes Conda along with a large number of pre-installed packages. To install Miniconda, you need to download the installer script and run it.

#!/bin/bash

# Download the Miniconda installer
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

# Make the installer executable
chmod +x Miniconda3-latest-Linux-x86_64.sh

# Run the installer
./Miniconda3-latest-Linux-x86_64.sh

# Follow the prompts to complete the installation

Try it in Google Colab: Open in Colab

Miniconda installation output will include prompts to review the license agreement, choose the installation location, and whether to initialize Miniconda.

Verifying the Installation

After installation, it's important to verify that Conda was installed correctly. You can do this by opening a new terminal or command prompt and running the command conda --version. This will print the version of Conda installed.

import subprocess

# Run the command to check Conda version
result = subprocess.run(["conda", "--version"], capture_output=True, text=True)

# Print the output
print(result.stdout)
Expected output:
conda 4.10.1

💡 Tip: Ensure you close and reopen your terminal or command prompt after installation to update the environment variables.

❓ What command do you use to verify the installation of Conda?

❓ What is the purpose of running the installer script with the `./` prefix?

← Previous Continue interactively → Next →

Related Courses