**TL;DR:** Use `uv` in the shebang for your script.
```python
#!/usr/bin/env -S uv --quiet run --script
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "python-dateutil",
# ]
# ///
#
# [python script that needs dateutil]
print("put your py code in here")
```
Thanks to this comment: https://news.ycombinator.com/item?id=42858954
---
I only recently discovered `uv` and so far I've been impressed. It seems to make Python stuff Just Work™ in ways I've never seen before.
Seeing that you can specify both the Py version and dependencies within a comment seems very powerful for scripting.
Not that I do much scripting these days, but I'm happy to see it either way.