conda vs poetry vs uv vs pip
How I combine conda, poetry, uv, and pip to keep local Python environments sane and make CI/Docker builds 10–100× faster.
- Published
- Updated
- Reading
- 3 min
- Author
- Sudhanva Narayana
After spending a year debugging broken virtualenvs, slow Docker builds, and lockfile drift across ML repos, I split the work between conda, poetry, uv, and pip. Each tool does one job well and gets in the way when stretched into the others. Here is how I wire them together.
Local Development
- Use Conda to manage Python versions and isolated environments
- Conda is still hard to beat when you need multiple isolated Python versions (or non-Python system libraries) on one laptop.
- Spin up a clean environment with a pinned Python interpreter:
conda create -n local_env python=3.14 - Activate it:
conda activate local_env(your shell prompt switches to(local_env) $).
- Use Poetry for dependency resolution (
pyproject.toml+poetry.lock)- Add dependencies via Poetry so your
pyproject.tomlandpoetry.lockstay deterministic:poetry add numpy - Note on virtualenvs: By default, Poetry creates its own virtualenv behind the scenes, which it only enters if you prefix commands with
poetry run. On a dev machine where you’re already insideconda activate local_env, you only need Poetry for resolution and lockfile updates. - Once your dependencies are locked, install the project into your active Conda environment with
pip install -e .(orpip install .). That gives you fast, editable local imports right insidelocal_env.
- Add dependencies via Poetry so your
CI / DevOps / Docker Builds
- Skip Conda in containers
- Inside a Docker image or CI runner, the container is your isolation boundary, and
poetry.lockalready pins the exact dependency graph.
- Inside a Docker image or CI runner, the container is your isolation boundary, and
- Why plain
poetry installbottlenecks CI- Poetry’s dependency resolver is thorough, and locking dependencies with
poetry.lockis great, but runningpoetry installon a heavy ML stack (PyTorch, CUDA wheels, scientific libraries) in every CI job is still noticeably slow.
- Poetry’s dependency resolver is thorough, and locking dependencies with
- Pair Poetry’s lockfile with
uvfor 10–100× faster installs- Astral’s
uvis a Rust-based Python package installer that installs wheels in a fraction of the timepiporpoetry installtakes. - If your repo already standardizes on
poetry.lock, you don’t have to rip Poetry out to getuv’s speed. Export the locked requirements in under a second and pipe them straight intouv pip install --no-deps:uv pip install --no-deps -r <(poetry export --without-hashes -f requirements.txt)
- Because
poetry.lockalready resolved the full transitive graph,--no-depsletsuvdownload and unpack the exact pinned wheels into your virtualenv.
- Astral’s
- The fastest production/CI sequence
- Install all third-party wheels with
uv, then let Poetry register the root package itself:uv pip install --no-deps -r <(poetry export --without-hashes --with dev -f requirements.txt)poetry install --only-root
- Install all third-party wheels with
Summary (TL;DR)
On your laptop (local development)
- Conda to create and switch Python environments (
conda create,conda activate). - Poetry to add packages and maintain
pyproject.toml+poetry.lock. - Pip (
pip install -e .) for editable local installs inside the active Conda environment.
In CI and Docker builds (production)
- Keep
pyproject.tomlandpoetry.lockas your single source of truth. - Use
uv(10–100× faster thanpip) to install the exported lockfile in seconds. - Run entrypoints via
poetry runoruv runwith no Conda base image needed.
When to Use All Four
Combining four tools sounds over-engineered until you’re maintaining a monorepo full of 5 GB GPU wheels where developers want Conda on their MacBooks, release engineers want strict lockfiles, and nobody wants to wait twelve minutes for a CI container to build. If you’re starting a greenfield repo today with no legacy poetry.lock requirement, uv lock + uv sync can handle the whole flow on its own.
Related work
Production ML context
See how this topic connects to production ML systems, infrastructure, and inference.