# venvwrapper
[![Version on Pypi](https://img.shields.io/pypi/v/venvwrapper.svg)](https://pypi.python.org/pypi/venvwrapper/)
venvwrapper is a Python package that provides commands that make it easier to
manage Python virtual environments that are based on the
[venv](https://docs.python.org/3/library/venv.html) package from the Python
standard library.
Basically, venvwrapper is to venv what
[virtualenvwrapper](https://pypi.org/project/virtualenvwrapper/) is to
[virtualenv](https://pypi.org/project/virtualenv/):
It provides more convenient commands to make the management of virtual
environments easier. However, virtualenv supports only a subset of the
functionality of virtualenvwrapper.
venvwrapper combines nicely with virtualenvwrapper:
The virtual environments created by both packages can reside in the same
directory side by side, regardless which of the two created them. That
allows you to gradually convert your existing virtualenv/virtualenvwrapper
based environments to be based on venv.
Since Python 3.5, venv is the recommended tool for Python virtual environments,
as stated in
[Creating virtual environments](https://docs.python.org/3/library/venv.html#creating-virtual-environments):
```
The use of venv is now recommended for creating virtual environments.
```
Also note [this tweet](https://x.com/gvanrossum/status/1319328122618048514) by
the BDFL on the topic:
```
I use venv (in the stdlib) and a bunch of shell aliases to quickly switch.
```
## Supported shells
At this point, venvwrapper supports bash and zsh. More shells may work, but
not with tab completion.
Contributions to add support for more shells are welcome!
## Installation
* Install the venvwrapper Python package into your default system Python 3 (i.e.
with no virtual environment active):
```
$ pip3 install --break-system-packages venvwrapper
```
This installs the `venvwrapper.sh` script so that it is available in the
PATH.
Note that this Python package has no Python dependencies, so it does not break
your system Python in any way.
* Verify that `venvwrapper.sh` is available in the PATH:
```
$ which venvwrapper.sh
/opt/homebrew/bin/venvwrapper.sh
```
* Add the following to your shell startup script (e.g. `~/.bash_profile` or
`~/.zshrc`) in a place where no Python virtual environment is active:
```
# VENV_HOME=$HOME/.venv
venv_wrapper=$(which venvwrapper.sh)
if [[ -n $venv_wrapper ]]; then
source $venv_wrapper
fi
```
`VENV_HOME` specifies the directory under which the directories for the
virtual environments are created. If not set, it defaults to `$HOME/.venv`.
`VENV_HOME` can be set to the same directory that is used for
virtualenvwrapper (i.e. its `WORKON_HOME` directory).
* Verify the installation by starting a new terminal session, and invoking:
```
$ mkvenv --help
```
This should display the help:
```
mkvenv - Create and activate a new Python virtual environment
Usage: mkvenv ENV [PYTHON]
Where:
ENV Name of the new virtual environment
PYTHON Python command to use for creation. Default: python3
```
## Usage
All commands provided by venvwrapper explain their usage when called with `-h`
or `--help`:
* `venv` - activate an existing virtual environment
* `mkvenv` - create and activate a new virtual environment
* `rmvenv` - remove one or more virtual environments
* `lsvenv` - list existing virtual environments
The `venv` and `rmvenv` commands support tab completion.
The standard `deactivate` script provided by the virtual environment is used
to deactivate the current virtual environment.
An active virtual environment is indicated by an `(env)` prefix in the command
prompt. That is the normal behavior of venv.
The commands provided by venvwrapper are actually shell functions, so they
cannot be used in other scripts. If you need to activate virtual environments
in other scripts, call the `activate` script provided by the virtual
environment.
If venvwrapper is configured to use the same directory for its virtual
environments as virtualenv/virtualenvwrapper, then the commands that operate on
existing virtual environments can be used on either kind of virtual environment,
regardless of which package created it. For example, `lsvenv` will list both
kinds of virtual environments.
## Development and contributions
The venvwrapper project welcomes contributions.
For how to set up a development environment, see [DEVELOP.md](DEVELOP.md).
## References
The venvwrapper.sh script provided in this package is based on the script
by Ismail Demirbilek at
https://gist.github.com/dbtek/fb2ddccb18f0cf63a654ea2cc94c8f19.
Raw data
{
"_id": null,
"home_page": null,
"name": "venvwrapper",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": "Andreas Maier <andreas.r.maier@gmx.de>",
"keywords": "venv, virtualenv, virtualenvwrapper",
"author": null,
"author_email": "Andreas Maier <andreas.r.maier@gmx.de>",
"download_url": "https://files.pythonhosted.org/packages/9b/71/3fbc4346e255496c546722e9f0ad94a41d7f96ed92c8461735e6f64ab38c/venvwrapper-0.9.0.tar.gz",
"platform": null,
"description": "# venvwrapper\n\n[![Version on Pypi](https://img.shields.io/pypi/v/venvwrapper.svg)](https://pypi.python.org/pypi/venvwrapper/)\n\nvenvwrapper is a Python package that provides commands that make it easier to\nmanage Python virtual environments that are based on the\n[venv](https://docs.python.org/3/library/venv.html) package from the Python\nstandard library.\n\nBasically, venvwrapper is to venv what\n[virtualenvwrapper](https://pypi.org/project/virtualenvwrapper/) is to\n[virtualenv](https://pypi.org/project/virtualenv/):\nIt provides more convenient commands to make the management of virtual\nenvironments easier. However, virtualenv supports only a subset of the\nfunctionality of virtualenvwrapper.\n\nvenvwrapper combines nicely with virtualenvwrapper:\nThe virtual environments created by both packages can reside in the same\ndirectory side by side, regardless which of the two created them. That\nallows you to gradually convert your existing virtualenv/virtualenvwrapper\nbased environments to be based on venv.\n\nSince Python 3.5, venv is the recommended tool for Python virtual environments,\nas stated in\n[Creating virtual environments](https://docs.python.org/3/library/venv.html#creating-virtual-environments):\n```\nThe use of venv is now recommended for creating virtual environments.\n```\n\nAlso note [this tweet](https://x.com/gvanrossum/status/1319328122618048514) by\nthe BDFL on the topic:\n```\nI use venv (in the stdlib) and a bunch of shell aliases to quickly switch.\n```\n\n## Supported shells\n\nAt this point, venvwrapper supports bash and zsh. More shells may work, but\nnot with tab completion.\n\nContributions to add support for more shells are welcome!\n\n## Installation\n\n* Install the venvwrapper Python package into your default system Python 3 (i.e.\n with no virtual environment active):\n\n ```\n $ pip3 install --break-system-packages venvwrapper\n ```\n\n This installs the `venvwrapper.sh` script so that it is available in the\n PATH.\n\n Note that this Python package has no Python dependencies, so it does not break\n your system Python in any way.\n\n* Verify that `venvwrapper.sh` is available in the PATH:\n\n ```\n $ which venvwrapper.sh\n /opt/homebrew/bin/venvwrapper.sh\n ```\n\n* Add the following to your shell startup script (e.g. `~/.bash_profile` or\n `~/.zshrc`) in a place where no Python virtual environment is active:\n\n ```\n # VENV_HOME=$HOME/.venv\n venv_wrapper=$(which venvwrapper.sh)\n if [[ -n $venv_wrapper ]]; then\n source $venv_wrapper\n fi\n ```\n\n `VENV_HOME` specifies the directory under which the directories for the\n virtual environments are created. If not set, it defaults to `$HOME/.venv`.\n\n `VENV_HOME` can be set to the same directory that is used for\n virtualenvwrapper (i.e. its `WORKON_HOME` directory).\n\n* Verify the installation by starting a new terminal session, and invoking:\n\n ```\n $ mkvenv --help\n ```\n\n This should display the help:\n\n ```\n mkvenv - Create and activate a new Python virtual environment\n\n Usage: mkvenv ENV [PYTHON]\n\n Where:\n ENV Name of the new virtual environment\n PYTHON Python command to use for creation. Default: python3\n ```\n\n## Usage\n\nAll commands provided by venvwrapper explain their usage when called with `-h`\nor `--help`:\n\n* `venv` - activate an existing virtual environment\n* `mkvenv` - create and activate a new virtual environment\n* `rmvenv` - remove one or more virtual environments\n* `lsvenv` - list existing virtual environments\n\nThe `venv` and `rmvenv` commands support tab completion.\n\nThe standard `deactivate` script provided by the virtual environment is used\nto deactivate the current virtual environment.\n\nAn active virtual environment is indicated by an `(env)` prefix in the command\nprompt. That is the normal behavior of venv.\n\nThe commands provided by venvwrapper are actually shell functions, so they\ncannot be used in other scripts. If you need to activate virtual environments\nin other scripts, call the `activate` script provided by the virtual\nenvironment.\n\nIf venvwrapper is configured to use the same directory for its virtual\nenvironments as virtualenv/virtualenvwrapper, then the commands that operate on\nexisting virtual environments can be used on either kind of virtual environment,\nregardless of which package created it. For example, `lsvenv` will list both\nkinds of virtual environments.\n\n## Development and contributions\n\nThe venvwrapper project welcomes contributions.\n\nFor how to set up a development environment, see [DEVELOP.md](DEVELOP.md).\n\n## References\n\nThe venvwrapper.sh script provided in this package is based on the script\nby Ismail Demirbilek at\nhttps://gist.github.com/dbtek/fb2ddccb18f0cf63a654ea2cc94c8f19.\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "Wrapper script for Python's venv",
"version": "0.9.0",
"project_urls": {
"Bug Tracker": "https://github.com/andy-maier/venvwrapper/issues",
"Source Code": "https://github.com/andy-maier/venvwrapper"
},
"split_keywords": [
"venv",
" virtualenv",
" virtualenvwrapper"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f5affe7e8842d6acab400f358399bbe6c59f9d0b5e572088c8f2276162ae660b",
"md5": "9b740d5f5b0559ccfcf0611bdb8523f3",
"sha256": "72578f5c389f1b46492b1587fa4cf7bcab510c3772f3f76262b3c45d87602833"
},
"downloads": -1,
"filename": "venvwrapper-0.9.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9b740d5f5b0559ccfcf0611bdb8523f3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 8404,
"upload_time": "2024-12-15T07:41:02",
"upload_time_iso_8601": "2024-12-15T07:41:02.240485Z",
"url": "https://files.pythonhosted.org/packages/f5/af/fe7e8842d6acab400f358399bbe6c59f9d0b5e572088c8f2276162ae660b/venvwrapper-0.9.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9b713fbc4346e255496c546722e9f0ad94a41d7f96ed92c8461735e6f64ab38c",
"md5": "27cc35f22cfc9b8afacd519d89a82acb",
"sha256": "7a69083a8e8051facbc168ab8d207f0f354527f0fa0f674a93aa9fb061f8cebd"
},
"downloads": -1,
"filename": "venvwrapper-0.9.0.tar.gz",
"has_sig": false,
"md5_digest": "27cc35f22cfc9b8afacd519d89a82acb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 8099,
"upload_time": "2024-12-15T07:41:04",
"upload_time_iso_8601": "2024-12-15T07:41:04.743552Z",
"url": "https://files.pythonhosted.org/packages/9b/71/3fbc4346e255496c546722e9f0ad94a41d7f96ed92c8461735e6f64ab38c/venvwrapper-0.9.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-15 07:41:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "andy-maier",
"github_project": "venvwrapper",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "venvwrapper"
}