uv install package with pip

waketzheng / 2025-02-18 / 原文

How to

1. export

uv export --frozen --no-hashes -o dev_requirements.txt

--frozen表示只输出txt,不更新uv.lock文件

2. create venv and install pip

uv venv --python 3.11 --prompt xxx-3.11
source .venv/*/activate # Linux/Mac/GitBash
.venv\Scripts\activate # Windows
python -m ensurepip
python -m pip install --upgrade pip

3. make deps

python -m pip install -r dev_requirements.txt