This.
venv
pip-tools
Specify your primary dependencies in pyproject.toml and use pip-compile to keep stuff locked in requirements.txt to exact versions (or even hashes).
Though after working with cargo a bit, I would love to have all of this in a first-class program, hope uv can get there.
Formating of the configuration content under point 4 seems to have spilled out, you might have to use a triple backtick followed by newline if it’s a multiline code/content.