Integrating Uv, Conda and Pip without Going Crazy
Last updated:
Table of Contents
- Create and Activate a Conda Virtualenv
- Install uv into the newly-created Conda virtualenv using pip
- Sync the Conda Virtualenv from a Legacy requirements.txt File Using Uv
- Compile Dependencies into a Legacy requirements.txt File
WIP Alert This is a work in progress. Current information is correct but more content may be added in the future.
See also Conda, Pip, Virtualenv and Pyenv: Commands Compared
My current setup on MacOS is as follows:
- Manage virtualenvs with Conda
- Manage dependencies with
uvbut also usepipin some legacy projects - Download, compile and sync dependencies with
uv
Create and Activate a Conda Virtualenv
I recommend you set a specific Python version
$ conda create -n my-venv python=3.9.16$ conda activate my-venv
Install uv into the newly-created Conda virtualenv using pip
(my-venv)$ pip install uv
Sync the Conda Virtualenv from a Legacy requirements.txt File Using Uv
(my-venv)$ uv pip sync requirements.txt
Compile Dependencies into a Legacy requirements.txt File
(my-venv)$ uv pip compile requirements.in -o requirements.txt