Getting Started with Miniconda

Python Environments

Getting Started with Miniconda

A beginner-friendly guide to Conda environments, isolated project setups, and the small workflow that prevents package conflicts from wrecking your Python projects.

Main problem

Different projects need different Python and package versions.

Main fix

Create one isolated Conda environment per project.

Main habit

Never do real project work in the base environment.

Why Miniconda matters If you have ever installed a package for one Python project and accidentally broken another, you have already run into dependency conflicts. Miniconda gives you a clean way to isolate projects so they stop interfering with each other.

The basic Conda workflow

  1. Create an environment
  2. Activate it
  3. Install packages inside it
  4. Do your work
  5. Export the environment when you need to share or rebuild it
Foundations

What is Miniconda?

Miniconda is a minimal Conda installation. It includes Conda, Python, and a small set of core dependencies.

Unlike Anaconda, which installs a much larger collection of packages up front, Miniconda gives you only the basics and lets you install the rest yourself.

Why that is useful Miniconda stays smaller, cleaner, and more flexible. You install only what a project actually needs.
Core Idea

What is a Conda Environment?

A Conda environment is an isolated workspace for a project.

Each environment can have:

  • its own Python version
  • its own packages
  • its own dependency graph
Project A
Python 3.10
numpy 1.26

Project B
Python 3.8
numpy 1.21

Both environments can live on the same machine without conflicts.

The simplest rule to remember Create one environment per project.
Installation

Installing Miniconda

Installation changes slightly by operating system and CPU architecture.

macOS (Intel)

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash Miniconda3-latest-MacOSX-x86_64.sh

macOS (Apple Silicon: M1 / M2 / M3 / M4)

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh
bash Miniconda3-latest-MacOSX-arm64.sh

Linux

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh

Windows

Download the Windows installer and run it.

Important Windows note Do not add Miniconda to your PATH manually. The recommended approach is to use Anaconda Prompt or initialize Conda normally after installation.

After installation, open a new terminal and verify Conda is available:

conda --version
First Workflow

A Typical Miniconda Workflow

conda create --name project1 python=3.10
conda activate project1
conda install numpy pandas
conda export --from-history --file environment.yml

That is the basic pattern you will repeat constantly.

Environment Creation

Creating an Environment

Always specify the Python version when you create an environment.

conda create --name myenv python=3.10

Example:

conda create --name data-analysis python=3.11
Activation

Activating and Deactivating Environments

Activate an environment:

conda activate myenv

Your shell prompt will usually change to show the active environment:

(base) user@computer % conda activate myenv
(myenv) user@computer %

Deactivate it with:

conda deactivate
Package Management

Installing Packages

Install packages inside the active environment.

conda install numpy pandas matplotlib

Conda will resolve dependencies for you.

If a package is not available through Conda

You can use pip inside the environment:

pip install somepackage
Rule of thumb Use conda first. Use pip only when necessary.
Maintenance

Listing and Removing Environments

List environments:

conda env list

Remove an environment:

conda env remove --name myenv
Sharing

Exporting and Recreating Environments

If you want to share an environment or rebuild it later, export it to a file.

Recommended for new projects

conda export --from-history --file environment.yml

This keeps the file cleaner by recording the packages you explicitly asked for, instead of every fully resolved package in the environment.

Still supported

conda env export > environment.yml

Recreate the environment

conda env create -f environment.yml
Mistakes to Avoid

Common Beginner Mistakes

Installing packages in base

Avoid using base for actual project dependencies. Create a new environment instead.

Forgetting to activate the environment

If the environment is not active, packages may install somewhere you did not intend.

Mixing pip and conda randomly

This is one of the fastest ways to make environments harder to reproduce.

Reference

Useful Commands

Task Command
Check Conda version conda --version
Create environment conda create --name myenv python=3.10
Activate environment conda activate myenv
Deactivate environment conda deactivate
Install packages conda install numpy pandas
List environments conda env list
Export environment conda export --from-history --file environment.yml
Recreate environment conda env create -f environment.yml
Remove environment conda env remove --name myenv
Quick cheat sheet
conda create --name myenv python=3.10
conda activate myenv
conda install numpy pandas
conda export --from-history --file environment.yml
conda deactivate

Frequently Asked Questions

What is the difference between Conda and Miniconda?

Conda is the package and environment manager. Miniconda is the minimal installer that gives you Conda plus Python and core dependencies.

Is Miniconda better than Anaconda?

Miniconda is usually better if you want a smaller install and tighter control over what gets added to your machine.

Can Conda manage non-Python packages?

Yes. Conda can manage more than Python libraries, including some system-level dependencies and packages from other ecosystems.

Should I use pip or Conda?

Use Conda first. Use pip only when the package is not available through Conda.

Conclusion

The core Miniconda workflow is simple:

Create one environment per project. Pick the Python version explicitly. Install packages inside the environment. Export the environment when you need to share or rebuild it.

Once that habit becomes normal, dependency conflicts become much easier to manage.

Comments