conda vs poetry vs uv vs pip
Difference between conda vs poetry vs uv vs pip for managing, creating and using environments
- Published
- Updated
- Reading
- 3 min
- Author
- Sudhanva Narayana
After spending a year troubleshooting and researching Python packaging tools and installers, I’ve put together some best practices for managing Python environments and packages with conda, poetry, uv, and pip, for both development and deployment.
Local Development
- Use Conda to Create Environments
- Conda is great for isolating environments on the same machine.
- Create an environment:
conda create -n local_env python=3.14(creates an empty environment with Python 3.14). - Activate an environment:
conda activate local_env.- Example:
(local_env) user - $- you are now in thelocal_envenvironment.
- Example:
- Use Poetry to Manage Packages
- Poetry works with
pyproject.tomlto add and install packages. - Example:
poetry add numpyto add a package. - This process creates a
poetry.lockfile that manages dependency resolution. - Keep using
poetry add <package>to add packages. - Note: Poetry creates its own virtual environment, but it isn’t used directly unless
poetry runis invoked. This doesn’t affect us since we’re interested in package resolution. - Once ready, install the packages using
pip install .orpip install -e .wherepoetry.lockandpyproject.tomlare located. - This installs all packages into the current Conda environment (
local_env). - You can repeat this process for other environments, making it easy to switch between projects (e.g.,
dev_envandprod_env).
- Poetry works with
CI / DevOps / Docker Builds
- No Need for Conda
- At this stage, we assume
poetry.lockhas all required packages resolved. - Use Poetry to Set Up Environments
poetry.lockandpyproject.tomlare key for dependency management.- Use
poetry installto install packages andpoetry runto execute anything. - Poetry creates a local virtual environment (
venv) that’s only invoked withpoetry run. - Alternatively,
poetry shellcan be used to activate the environment temporarily, though this is not recommended for production use.
- Poetry Install Speed
- Despite improvements,
poetry installcan still be slow (although it is 10x faster thanpip installand 20x faster thanconda install).
- Despite improvements,
- At this stage, we assume
- Use
uvfor Fast Installationsuvis a Rust-based package installer, and it’s much faster.- Requires
requirements.txt, which can be generated by Poetry:poetry export --without-hashes -f requirements.txt- This takes less than 1 second to generate.
- Run the following command to install dependencies:
uv pip install --no-deps -r <(poetry export --without-hashes -f requirements.txt)
uvusespipunder the hood and creates a virtual environment much faster than Poetry.- After using
uv, runpoetry installto update the Poetry source tree. - This lets you keep Poetry for day-to-day development and use
uvfor fast installations.
- Fastest Installation Method
- For production environments, you can combine commands for speed:
uv pip install --no-deps -r <(poetry export --without-hashes --with dev -f requirements.txt)- Then update with:
poetry install --only-root
- For production environments, you can combine commands for speed:
Summary (TL;DR)
If Developing Locally/Natively
- Use Conda to create environments.
- Use Poetry to resolve and install packages.
- Use Pip for installing packages or editable packages.
Everywhere Else (Production)
- Use
poetry.lockandpyproject.tomlto craft your environment (10x faster than Conda). - Use
uvto install dependencies (10x faster thanpoetry install, 30x faster thanconda install). - Use Poetry to run or execute scripts (no Conda environment needed).
- Optionally,
uv runalso exists.
Conclusion
Combining conda, poetry, pip, and uv this way has a learning curve that not every team is ready for. Many teams may find it over-engineered, especially if they don’t need the small speedups uv provides.
Related work
Production ML context
See how this topic connects to production ML systems, infrastructure, and inference.