Video: https://youtu.be/mSGSTPkgP0w
Written version: https://cloudexplainers.com/python-uv-vs-pip-which-one-should-you-use/
Everything below ran for real in the video. Run it in a throwaway machine or container, never on a computer you care about.
The machine the video used, as files you can build it from:
Build and open it (Docker):
docker build -t lab lab
docker run -it --rm lab bash# ana@laptop:~/shop$
cat requirements.txt
time (python3 -m venv .venv && .venv/bin/pip install -q -r requirements.txt)
rm -rf .venv && time (uv venv -q && uv pip install -r requirements.txt)# ana@laptop:~/shop$
pip --version
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
uv --version# ana@laptop:~/shop$
rm -rf .venv && time (python3 -m venv .venv && .venv/bin/pip install -q -r requirements.txt)
rm -rf .venv && time (uv venv -q && uv pip install -r requirements.txt)# ana@laptop:~/shop$
stat -c '%h links: %n' .venv/lib/python3.12/site-packages/pandas/__init__.py
du -sh ~/.cache/pip ~/.cache/uv# ana@laptop:~/shop$
rm -rf .venv && uv init --bare
uv add -r requirements.txt
cat pyproject.toml
grep -c '^name = ' uv.lock
grep -A2 '^name = "pandas"' uv.lock
uv run app.py
uv python install 3.13
uv run --python 3.13 python --version
python3 --version# ana@laptop:~/shop$
source .venv/bin/activate
# (shop) ana@laptop:~/shop$
pip install rich
which pip
python -m pip --version
uv add rich
deactivate
# ana@laptop:~/shop$
cd ~ && uv pip install rich
# ana@laptop:~$
uv venv --seed -q seeded && ls seeded/binFrom Cloud Explainers. Lab files are MIT licensed (see the repository's LICENSE).