What does "pyenv virtualenvwrapper" do?

Viewed 79

I am using pyenv with virtualenvwrapper.

For using virtualenvwrapper (without pyenv) I have in my .bash_profile source /usr/local/bin/virtualenvwrapper.sh

When using pyenv with virtualenvwrapper plugin what exactly does pyenv virtualenvwrapper do ?

What I see online is this is required to setup a virtualenvwrapper into your shell. Is it still required if I have sourced virtualenvwrapper.sh ?

To add some more details: as per https://alysivji.github.io/setting-up-pyenv-virtualenvwrapper.html

Anytime we install a new version of Python, we will need to install 
virtualenvwrapper. This is done with either the pyenv 
virtualenvwrapper or pyenv virtualenvwrapper_lazy

Is it required only once when a new version of python is installed in pyenv ?

1 Answers

In short, from the pyenv-virtualenvwrapper readme:

pyenv-virtualenvwrapper is a pyenv plugin which provides a pyenv virtualenvwrapper command to manage your virtualenvs with virtualenvwrapper.

There are three tools involved here:

  1. virtualenv or venv - Used for isolating python environments (collections of packages) by using 'virtual environments'. virtualenv has been more or less superseded by venv, but for the purpose of this answer, they are interchangeable.
  2. virtualenvwrapper - A set of tools for automating some of the steps involved in using virtualenv or venv.
  3. pyenv-virtualenvwrapper is a plugin that allows virtualenvwrapper to work with pyenv
  4. pyenv - a tool for managing multiple versions of python on the same computer system.

Another way to manage virtual environments when using pyenv is pyenv-virtualenv

Related