Python Environments
On this page
Search for almost any Python question and you will land on a tutorial that opens by telling you to install Anaconda and type conda create. This course uses a different tool, uv. This page explains what these tools do, why the course picked the one it did, and how to read a tutorial written for one of the others.
The problem all of them solve#
A piece of analysis needs a particular version of Python and particular versions of the packages it imports. Install everything into one system-wide Python and the first project that needs pandas 2 quietly breaks the second one that needs pandas 3.
Every tool on this page fixes that the same way, by giving each project its own private set of packages. They differ in where the packages come from, how carefully they write down what got installed, and how much you have to remember.
conda, and mamba#
conda came out of scientific computing, and its packages live in channels, the largest of which is conda-forge. A conda package can contain compiled software that has nothing to do with Python: a C library, a Fortran compiler, R, a CUDA toolkit. That capability is what conda was built for, and it is why people still choose it.
conda create -n myproject python=3.14
conda activate myproject
conda install pandas
python analysis.pyThe environment lives in a central folder on your machine, keyed by the name you gave it. Your code lives somewhere else. The two are connected by you remembering which name goes with which folder.
conda activate is also a step you can forget. Forgetting it is the most common way a conda tutorial fails for somebody doing it the first time, because the next command runs against the wrong Python and the error message says nothing about environments.
mamba is a drop-in replacement for the conda command that resolves much faster. Same packages, same channels, same layout. When you meet it in a tutorial, read it as conda.
pixi#
pixi is recent, and it comes from the same conda ecosystem. It keeps conda's ability to install software that is not a Python package, and it changes the parts that make conda awkward. The environment lives in your project folder. A lock file records exact versions. There is no activate step, because pixi run enters the environment for you.
pixi init myproject
cd myproject
pixi add python pandas
pixi run python analysis.pyFor Python packages with no conda build, pixi calls uv's resolver internally, so a piece of uv is already running inside pixi.
uv#
uv does for PyPI what pixi does for conda-forge. The environment lives in your project folder, uv.lock records exact versions, uv run enters the environment for you, and uv installs Python itself, so Python is never something you download separately.
uv init myproject --python 3.14
cd myproject
uv add pandas
uv run python analysis.pyHow conda, pixi and uv compare#
| conda | pixi | uv | |
|---|---|---|---|
| start a project | conda create -n p python=3.14 |
pixi init p |
uv init p --python 3.14 |
| add a package | conda install pandas |
pixi add pandas |
uv add pandas |
| run something | conda activate p, then python x.py |
pixi run python x.py |
uv run python x.py |
| install what a project needs | conda env create -f environment.yml |
pixi install |
uv sync |
| where the environment lives | central folder, keyed by name | your project folder | your project folder |
| exact versions written down | by convention, if somebody bothers | pixi.lock, always |
uv.lock, always |
| packages come from | conda channels | conda channels and PyPI | PyPI |
| installs Python for you | yes | yes | yes |
Why this course uses uv#
Everything here is on PyPI. marimo, DuckDB, pandas and Altair are Python packages with ready-built versions for Windows, macOS and Linux. The thing conda is uniquely good at never comes up.
There is no activate step. uv run is one command with no state in front of it, which removes an entire category of confusing failure from the first three weeks.
Your environment is two committed files. pyproject.toml and uv.lock sit in your repository next to your notebooks. Anybody who clones it types uv sync and has your exact versions. This course grades whether your numbers are right, and a number is checkable only if somebody else can reproduce the run that produced it.
Installing a package takes a second or two. That matters most during class, when everybody adds the same package at the same time and any wait becomes everybody's wait.
When you would want conda or pixi instead#
Some software is genuinely outside Python and is painful to install any other way. Geospatial work needs GDAL. GPU work needs a CUDA toolkit. Bioinformatics pipelines pull in command-line tools written in C. Some teams run R and Python side by side in one environment. conda-forge packages all of that as ready-built binaries, and PyPI often does not.
If you land in that world after this course, pixi is the modern way into it, and the four jobs in the table above are the same four jobs there.
Reading a tutorial written for conda#
Most of the time you can follow it with these substitutions:
| the tutorial says | you type |
|---|---|
conda create -n env python=3.12 |
uv init --app --no-package --python 3.14, in your repository |
conda activate env |
nothing. uv run handles it |
conda install X or pip install X |
uv add X |
python script.py |
uv run python script.py |
jupyter notebook |
uv run marimo edit |
The substitution fails in one case, and it is worth recognizing. If the tutorial installs something that is obviously not a Python package, such as conda install gdal or conda install -c conda-forge r-base, then uv add will either fail or give you a thin wrapper around software you still do not have. That tutorial wants the conda ecosystem, and it is a fair reason to install pixi for that one project.
What to do about Anaconda#
Do not install it for this course. It is a large download, it places a second Python on your system, and the two then compete over which one answers when you type python. Sorting out which Python is which costs an afternoon, and starting without Anaconda avoids it.
If you already have it from another course, leave it alone and let uv work in your project folder. The two coexist. Any time a command behaves strangely, check the terminal prompt for a name in parentheses at the front, which is conda telling you an environment is active. conda deactivate clears it.
Last updated: Friday, 9/25/2026