Anaconda Complete Guide for Beginners | Python Environments
Struggling with Python version conflicts and dependency hell? This beginner's guide walks you through Anaconda installation, environment creation, and team collaboration—from setup to sharing reproducible environments with your team.
Install and Manage Python Environments Using Anaconda — A Beginner’s Complete Guide
You’ve installed Python three different ways, broken your system packages twice, and you still can’t figure out why your NumPy version conflicts with your colleague’s code. Meanwhile, every tutorial assumes you already know what a “virtual environment” is—and nobody’s explaining why you need one or how to actually use it without breaking everything again.
That ends today. This guide walks you through Anaconda from installation to sharing reproducible environments with your team—no prior knowledge required.
Series Navigation:
This is Part 1 of the Anaconda Fundamentals series.
Coming next: Part 2 — Using Anaconda Environments Inside Jupyter Notebook
What Anaconda Actually Solves
Anaconda is a Python distribution, package manager, and environment manager rolled into one. It solves the “dependency hell” problem where different projects need conflicting package versions—NumPy 1.24 for one project, NumPy 1.26 for another—and your system Python can’t handle both.
Here’s what you get:
- 250+ pre-installed data science packages (NumPy, pandas, matplotlib, scikit-learn)
- Isolated environments — each project gets its own Python version and package set
- Cross-platform consistency — works identically on Windows, macOS, and Linux
- 10+ years as the industry standard for data science and ML workflows
The key benefit: work on multiple projects simultaneously without version conflicts. One environment for a legacy TensorFlow 1.x project, another for cutting-edge PyTorch 2.x research—both running side-by-side without interference.
Prerequisites
Before you start:
- No prior Python installation required (Anaconda includes Python)
- ~3 GB free disk space
- Administrator / sudo access on your machine
- Supported OS: Windows 10+, macOS 10.13+, or Linux (any major distro)
Optional: Text editor (VS Code, Sublime, Notepad++) for viewing YAML files later
Installation
Step 1: Download Anaconda
Navigate to anaconda.com, click Free Download, then Get Started. You’ll see a sign-up form asking for email, Google, Microsoft, or GitHub authentication.
Skip the sign-up: Go directly to repo.anaconda.com/archive/. Scroll to late 2024 or early 2025 releases and download the installer for your OS:
- Windows:
.exefile - macOS / Linux:
.shfile
Step 2: Run the Installer
Windows:
Double-click the .exe file and follow the prompts. Accept the defaults unless you have specific requirements. If offered, check “Add Anaconda to my PATH environment variable”—this makes terminal commands work immediately.
macOS / Linux:
bash Anaconda3-2024.XX-X-MacOSX-x86_64.sh
Press Enter to review the license, type yes to accept, confirm the installation location (default is fine), and type yes when asked to initialize Anaconda.
Step 3: Verify Installation
Close and reopen your terminal completely, then run:
conda --version
Expected output: conda 24.11.3 (or similar).
You should also see (base) appear before your terminal prompt—this indicates you’re in Anaconda’s default environment.
Core Workflow: Managing Environments
Check Your Current Setup
conda info
This shows your active environment name, Python version, installation paths (critical for troubleshooting), and platform details. The paths output is especially important—it tells you where Anaconda installed Python and where it stores environments.
Create a New Environment
conda create -n testenv python=3.12
What this does:
-n testenvnames the environment “testenv”python=3.12installs Python 3.12 in this isolated space- Press
ywhen prompted to proceed
Depending on your internet connection, this takes 30 seconds to a few minutes.
Activate the Environment
conda activate testenv
Your terminal prompt changes from (base) to (testenv)—you’re now working inside this isolated environment. Any packages you install here won’t affect your base environment or other projects.
Install Packages
conda install numpy pandas matplotlib
Or use pip if a package isn’t available in conda:
pip install flask
Both package managers work. Conda handles dependencies better (it checks compatibility across all installed packages), while pip has a larger package catalog. Best practice: try conda first, fall back to pip for packages not in conda repositories.
List All Environments
conda env list
Shows all environments plus their file system paths. The currently active environment has an asterisk * next to it.
List Installed Packages
conda list
Displays every package in your current environment with exact version numbers. This is invaluable when debugging—you can instantly see if you’re running NumPy 1.24 or 1.26.
Deactivate and Remove an Environment
conda deactivate
conda env remove -n testenv
⚠️ Note: You cannot delete an environment you’re currently using. Always deactivate first, then remove.
Practical Example: Sharing Your Environment
Scenario: You built a data analysis project with specific package versions. A teammate needs to replicate your exact setup to reproduce your results.
Step 1: Create a Project Directory
mkdir my_project
cd my_project
Step 2: Export Your Environment
conda env export > environment.yaml
This creates an environment.yaml file containing your environment name, all packages and exact versions, channel sources, and pip-installed packages (if any). The file is typically 5-20 KB—small enough to version control.
Step 3: Share the File
Send environment.yaml to your teammate via email, Slack, or commit it to your Git repository.
Step 4: Your Teammate Recreates the Environment
Your colleague runs:
conda env create -f environment.yaml
Conda reads the YAML file and installs everything identically—same Python version, same NumPy version, same matplotlib version. No version mismatches, no “it works on my machine” problems.
Common Issues & Fixes
“conda: command not found” After Installation
Symptom: You installed Anaconda, but typing conda in terminal returns an error.
Fix: Your shell hasn’t reloaded its configuration. Close your terminal completely and reopen it. If the problem persists:
macOS / Linux:
export PATH=~/anaconda3/bin:$PATH
Windows: Re-run the installer and ensure you select “Add Anaconda to my PATH environment variable” during installation.
Can’t Remove an Environment
Symptom: Running conda env remove -n testenv returns an error saying the environment is in use.
Fix: You’re still inside the environment. Deactivate first:
conda deactivate
Then retry the removal command.
Package Not Found in Conda
Example: conda install flask returns “PackagesNotFoundError.”
Fix: The package exists in pip but not conda. Use pip instead:
pip install flask
Conda and pip coexist peacefully in the same environment—use both as needed.
Slow Package Installation
Symptom: conda install hangs for 5-10 minutes on “Solving environment.”
Cause: Conda is checking compatibility across hundreds of packages to avoid conflicts.
Fix: Install mamba, a drop-in replacement for conda that’s 5-10x faster:
conda install mamba -c conda-forge
mamba install numpy pandas
Same syntax, dramatically faster. I use mamba for all package installations now.
Next Steps
Now that you have Anaconda working:
- Learn Jupyter Notebook integration (Part 2 of this series—coming next week)
- Explore the
conda-forgechannel for community-maintained packages - Try
mambafor faster installations - Configure VS Code to auto-detect conda environments
Related tools to explore:
- Poetry — alternative for pure Python projects (less suited for data science)
- Docker — for full system-level reproducibility including OS dependencies
- Git — version control your
environment.yamlfiles alongside your code
What’s your current workflow for managing Python dependencies? Are you still using system Python, or have you tried virtualenv, Poetry, or another tool? Reply and let me know—I read every comment and answer questions within 24 hours.
How do you currently manage Python dependencies across your projects—and have you hit version conflicts yet?
Comments