blob: 0490ae1b841f4c64801817bd971ad6d4cf93b7e1 [file] [log] [blame]
.. image::
:alt: Latest version on PyPI
.. image::
:alt: PyPI - Implementation
.. image::
:alt: PyPI - Python Version
.. image::
:alt: Documentation status
.. image::
:alt: Gitter
.. image::
:alt: PyPI - Downloads
.. image::
:alt: PyPI - License
.. image::
:alt: Open issues
.. image::
:alt: Open pull requests
.. image::
:alt: Package popularity
``virtualenv`` is a tool to create isolated Python environments. Since Python ``3.3``, a subset of it has been
integrated into the standard library under the `venv module <>`_. The
``venv`` module does not offer all features of this library, to name just a few more prominent:
- is slower (by not having the ``app-data`` seed method),
- is not as extendable,
- cannot create virtual environments for arbitrarily installed python versions (and automatically discover these),
- is not upgrade-able via `pip <>`_,
- does not have as rich programmatic API (describe virtual environments without creating them).
The basic problem being addressed is one of dependencies and versions, and indirectly permissions.
Imagine you have an application that needs version ``1`` of ``LibFoo``, but another application requires version
``2``. How can you use both these libraries? If you install everything into your host python (e.g. ``python3.8``)
it's easy to end up in a situation where two packages have conflicting requirements.
Or more generally, what if you want to install an application *and leave it be*? If an application works, any change
in its libraries or the versions of those libraries can break the application. Also, what if you can't install packages
into the global ``site-packages`` directory, due to not having permissions to change the host python environment?
In all these cases, ``virtualenv`` can help you. It creates an environment that has its own installation directories,
that doesn't share libraries with other virtualenv environments (and optionally doesn't access the globally installed
libraries either).
Useful links
**Related projects, that build abstractions on top of virtualenv**
* :pypi:`virtualenvwrapper` - a useful set of scripts for creating and deleting virtual environments
* :pypi:`pew` - provides a set of commands to manage multiple virtual environments
* :pypi:`tox` - a generic virtualenv management and test automation command line tool, driven by a ``tox.ini``
configuration file
* :pypi:`nox` - a tool that automates testing in multiple Python environments, similar to tox,
driven by a ```` configuration file
* `Corey Schafer tutorial <>`_ on how to use it
* `Using virtualenv with mod_wsgi <>`_
**Presenting how the package works from within**
* `Bernat Gabor: status quo of virtual environments <>`_
* `Carl Meyer: Reverse-engineering Ian Bicking's brain: inside pip and virtualenv
.. comment: split here
.. toctree::