If you are confused about how to setup different python environments in your system, here is how I do it.
pyenv install <version>
-> installs a new version
of python
pyenv global <version>
-> sets an installed
version as global python version
pyenv local <version>
-> sets an installed
version as local(to the directory) python version. Notice a
.python-version
file generated.
python -m venv .venv
-> create a new virtual
environment
source .venv/bin/activate
-> activate created virtual
environment