uv is a pip / virtualenv replacement

uv can be used as a shebang line1

#!/usr/bin/env -S uv run --script

combined with inline script metadata you can specify your dependencies within the script:

#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.11"
# dependencies = [
#   "flickrapi",
# ]
# ///

Install from a git repo branch

pip install git+https://github.com/repoowner/reponame.git@branchname

Setting up python on macOS and zsh

Install pyenv and the useful plugins for virtualenv and virtualenv wrapper:

brew install pyenv pyenv-virtualenv  pyenv-virtualenvwrapper

You then have to hook pyenv into your shell:

echo 'eval "$(pyenv init --path)"' >> ~/.zsh/pyenv_profile
echo 'eval "$(pyenv init -)"' >> ~/.zsh/pyenv_zshrc

Restart your terminal. At this point you can install python versions like so:

pyenv install 3.10.0

You can install the latest version:

pyenv install $($PYENV_COMMAND install --list | grep --extended-regexp "^\s*[0-9][0-9.]*[0-9]\s*$" | tail -1 | xargs)

1. Allen, R. Using uv as your shebang line. https://akrabat.com/using-uv-as-your-shebang-line/ (2025).