uv
Note#186
2025-03-24
With this header, uv automatically creates and manages a dedicated virtual environment for your script.
#!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.13" # dependencies = [ # "package-name>=1.0.0", # "another-package", # ] # /// # Rest of the script...
uv add --script script.py dependency_1 dependency_2 dependency_3