Sometimes I only need requests for one quick check and do not want a venv for it.
uv run --with requests python -c "import requests; print(requests.__version__)"
uv run --with httpx --with rich python script.py
--with adds a package to a throwaway environment that uv builds from its cache and discards after the command, so nothing lands in your global site-packages. Repeat the flag for more packages. Inside a project directory the project’s own dependencies are included as well. The first run downloads the packages, later runs reuse the cache and start quickly. It is a quick way to test a library on a clean setup.
Further reading: uv documentation: running scripts