pyenv-virtualenv
pyenv-virtualenv copied to clipboard
.python-version and multiple virtualenvs (a la pyenv)
From pyenv
README:
You can also specify multiple versions in a .python-version file, separated by newlines or any whitespace.
Is something like this possible for pyenv-virtualenv
? An example use case would be having virtualenv for neovim
setup (similar to one described on deoplete-jedi
wiki) and separate virtualenvs for all other needs. Loading project-specific and neovim-specific virtualenv through .python-version
would allow to keep things like python-language-server or flake8 confined to neovim
virtualenv.
It seems like a much cleaner option than installing them as pip install --user
, although one would have to be careful about conflicting packages in different virtualenvs being used simultaneously.
Is this a feasible idea or am I over-complicating things?
I recommend not using pyenv activate
at all. You can use pyenv local
if you do not.
Say you have a virtualenv named myprojenv
you can do:
pyenv local myprojenv 3.6.4 2.7
And get the correct behaviour for that directory tree.
This seems like the closest issue to the problem I was having.
It doesn't seem possible to activate multiple virtualenvs at once -- because they are supposed to set envvars with the env's name (VIRTUAL_ENV
, CONDA_DEFAULT_ENV
).
If that's not a requirement though, we can try, with an experimental option or smth. Because software that interacts with virtualenvs may malfunction. At the very least, you won't be able to manage the overlayed virtualenv.