Getting Started with Miniconda
A beginner-friendly guide to Conda environments, isolated project setups, and the small workflow that prevents package conflicts from spilling across your Python projects.
MiniConda Series
environment.yml
How to save an environment cleanly and recreate it later on another machine or for another collaborator.
Read article
4
When to Use pip Inside a Conda Environment
Where pip fits into a Conda workflow and how to avoid careless mixing.
Read article
5
Common Conda Environment Mistakes and How to Avoid Them
The small habits that make environments harder to understand, harder to reproduce, and easier to break.
Read article
6
How to Remove Old Conda Environments Cleanly
A simple cleanup workflow for removing stale environments without losing reusable setup knowledge.
Read article
Different projects often need different Python versions and different package versions.
Create one isolated Conda environment per project.
Do not do real project work in the base environment.
If you have ever installed a package for one Python project and accidentally affected another, you have already met the problem Miniconda helps solve.
Miniconda gives you a clean way to isolate projects so dependencies stop interfering with each other.
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 package collection up front, Miniconda starts smaller and lets you add only what you actually need.
What Is a Conda Environment?
A Conda environment is an isolated workspace for a project.
Each environment can have its own:
- Python version
- packages
- dependency graph
Project A
Python 3.10
numpy 1.26
Project B
Python 3.8
numpy 1.21Both environments can live on the same machine without stepping on each other.
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.shmacOS (Apple Silicon)
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh
bash Miniconda3-latest-MacOSX-arm64.shLinux
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.shWindows
Download the Miniconda installer and run it through the normal installer flow.
After installation, open a new terminal and verify that Conda is available:
conda --versionThe Basic Conda Workflow
- Create an environment
- Activate it
- Install packages inside it
- Do your work
- Export the environment if you need to recreate or share it later
conda create --name project1 python=3.10
conda activate project1
conda install numpy pandas
conda export --from-history --file environment.ymlCreating an Environment
It is a good habit to specify the Python version when you create the environment.
conda create --name myenv python=3.10Example:
conda create --name data-analysis python=3.11Activating and Deactivating Environments
Activate an environment:
conda activate myenvYour prompt will usually change to show the active environment:
(base) user@computer % conda activate myenv
(myenv) user@computer %Deactivate it with:
conda deactivateInstalling Packages
Install packages inside the active environment.
conda install numpy pandas matplotlibConda will resolve dependencies for you.
If a package is not available through Conda
You can use pip inside the environment:
pip install somepackageListing and Removing Environments
List environments:
conda env listRemove an environment:
conda env remove --name myenvExporting 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.ymlThis keeps the file cleaner by recording the packages you explicitly asked for rather than every fully resolved package in the environment.
Still supported
conda env export > environment.ymlThis remains valid, but it often produces a fuller environment snapshot than beginners actually want.
Recreate the environment
conda env create -f environment.ymlCommon Beginner Mistakes
Installing project packages in base
The base environment is not the place for normal project dependencies. Create a dedicated 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.
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 |
A Small Cheat Sheet
conda create --name myenv python=3.10
conda activate myenv
conda install numpy pandas
conda export --from-history --file environment.yml
conda deactivateFrequently Asked Questions
These are the practical questions beginners usually have when starting with Miniconda.
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?
It is usually the better fit when you want a smaller install and tighter control over what gets added to your machine.
Should I use pip or Conda?
Use Conda first. Use pip only when the package is not available through Conda.
Why avoid the base environment for projects?
Because project dependencies pile up there quickly and make it easier for unrelated work to interfere with each other.
Why specify the Python version when creating an environment?
Because it makes the environment more predictable and easier to reproduce later.
What is the benefit of conda export --from-history?
It keeps the environment file cleaner by recording what you explicitly asked for instead of every fully resolved dependency.
Can Conda manage more than Python packages?
Yes. Conda can also manage some non-Python dependencies, which is one reason it is useful for scientific and cross-language environments.
What is the simplest beginner habit to keep?
Create one environment per project and activate it before doing any real work.
Conclusion
The core Miniconda workflow is simple: create one environment per project, choose the Python version explicitly, install packages inside that environment, and export the environment when you need to share or rebuild it.
Once that habit becomes normal, dependency conflicts become much easier to control.
Comments