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

How to manage existing virtual-envs?

Open mese79 opened this issue 6 years ago • 2 comments

Hi
I already have several virtual-envs created with python -m venv ....
Now I've installed pyenv and i'm looking for a way to introduce my virtual-envs to pyenv. Is there any way? or I have to re-create them and reinstall all packages?

mese79 avatar Jan 31 '20 18:01 mese79

From what I can tell this isn't possible, however it would be great if you could specify a path where a virtual environment should be created/activated/deleted from. This will allow users switching from the builtin venv (the de facto standard at this point) module to use their existing environments and mental models for how venvs work. Further, in my opinion at least, I find it easier to remember that venvs live inside the project directory rather than remembering an arbitrary naming scheme - in some sense the path to a project directory is a ready-to-use and unique namespace for virtual environments.

One could imagine a non-intrusive implementation of this feature where specifying a virtual environment name beginning with a . or / would be treated as a path to where a venv should be installed or activated from. For example, one could imagine a .python-version file with the following contents:

./venv

rmorshea avatar Apr 18 '20 14:04 rmorshea

So even I've .venv folders in several of my projects. Is it possible to use them with pyenv in any way currently?

eldos-dl avatar Jun 10 '21 05:06 eldos-dl