pyenv-virtualenv
pyenv-virtualenv copied to clipboard
Use venv when available instead of virtualenv
From what I can understand, currently virtualenv is used by default even if venv is present.
The README states:
pyenv-virtualenv uses python -m venv if it is available and the virtualenv command is not available.
Also from the code it seems that venv is not used if virtualenv is present.
Reading a previous issue ( https://github.com/pyenv/pyenv-virtualenv/issues/294 ), I assumed that venv was the preferred choice, but that doesn't seem to be the case anymore.
If you don't intend to use venv by default can you at least provide a flag to use it?
I would strongly suggest to use venv by default. With virtualenv I ended up with a 7 years old version of site.py.
Thank you for pyenv-virtualenv :)
Makes sense. Please consider creating a PR then.
Any news on that ?
@cscetbon likely not.
FWIW I (still) recommend to just not use pyenv-virtualenv, but other methods.
I prefer having an autocd-handler that activates a venv based on a .venv in its (parent) directory (https://github.com/Tarrasch/zsh-autoenv#automatically-activate-python-virtualenvs)
And creating a venv is as easy as python -m venv .venv, where you can use ~/.pyenv/versions/…/bin/python then if you need a specific version.
I think pyenv-virtualenv is so convenient that I'll keep that warning around 🤷♂️