Pyenv allows me to have different Python versions on my machine in parallel.
pyenv install 3.10.0
This gives me a Python 3.10 installation on my Mac in ~/.pyenv/versions/3.10.0/bin/python
.
Then, I can create a new virtual environment using the above path.
~/.pyenv/versions/3.10.0/bin/python -m venv /tmp/py310
And activate that virtual environment:
source /tmp/py310/bin/activate