This module includes tools for using virtual environments and installing packages using pip.
See also
Require a Python virtual environment.
from fabtools import require
require.python.virtualenv('/path/to/venv')
Require a Python package.
If the package is not installed, it will be installed using the pip installer.
Package names are case insensitive.
from fabtools.python import virtualenv
from fabtools import require
# Install package system-wide
require.python.package('foo', use_sudo=True)
# Install package in an existing virtual environment
with virtualenv('/path/to/venv'):
require.python.package('bar')
Require several Python packages.
Package names are case insensitive.
Require Python packages from a pip requirements file.
Require pip to be installed.
If pip is not installed, or if a version older than version is installed, the latest version will be installed.
Require setuptools to be installed.
If setuptools is not installed, or if a version older than version is installed, the latest version will be installed.