Check out uv; it can automatically create an appropriate virtual environment when a script runs.
uv is the best thing to happen to the Python ecosystem in a decade
uv