pyenv-virtualenv icon indicating copy to clipboard operation
pyenv-virtualenv copied to clipboard

.python-version and multiple virtualenvs (a la pyenv)

Open boojum opened this issue 6 years ago • 1 comments

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?

boojum avatar Apr 15 '18 18:04 boojum

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.

jarshwah avatar Jun 25 '18 06:06 jarshwah

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).

native-api avatar Apr 12 '24 19:04 native-api

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.

native-api avatar Apr 13 '24 06:04 native-api