Minimum virtual environment management, in portable POSIX Shell.
mkvirtualenv VENV- Create a new virtual environmentworkon VENV- Activate a virtual environmentlsvirtualenv- List all virtual environmentsrmvirtualenv VENV- Delete a virtual environment
WORKON_HOME- If defined, virtual environments will be placed in this directory. Otherwise, virtual environments will be created in$HOME/.virtualenvs/
$ . ./minimum-envwrapper.sh # (But really, put this in your shell rc.)
$ lsvirtualenv
$ mkvirtualenv new-venv
$ lsvirtualenv
new-venv
$ workon new-venv
$ which python
/home/user/.virtualenvs/new-venv/bin/python
$ rmvirtualenv new-venv
$ lsvirtualenv
$
- A POSIX compliant shell (BASH, ZSH, KSH, DASH, etc)
- The
venvmodule, from the python3 standard library
- This prevents me from needing to set up a virtual environment, so that I can manage my virtual environments.
- python2 is finally dead, so this can rely on the python3
venvmodule. - I only used these 4 commands anyway.
- The alternatives were not compatible with
ksh.