I have read often pyenv helps maintain different version of python on same system. But if that is also possible by virtualenv/venv what am I missing?
I have read often pyenv helps maintain different version of python on same system. But if that is also possible by virtualenv/venv what am I missing?
There's no flag that I'm aware of that makes venv install a different Python version than the one it was invoked with.
> brew install python@3.9 python@3.10 python@3.11
No. I have no idea where you got that idea.
> But if that is also possible by virtualenv/venv what am I missing?
That it's not possible? venv is literally just a module of the standard distribution. And while virtualenv can do a few more things (hence why it remains as an independent project), installing new pythons is not something it can do.
Virtualenv and venv can only create environments for previously installed python (especially venv as you create environments via the python you want to create an env for, it doesn't support creating an env on behalf of a different python than the one it's invoked through).