fabtools.require.python

Python environments and packages

This module includes tools for using virtual environments and installing packages using pip.

See also

fabtools.python

Virtual environments

fabtools.require.python.virtualenv(directory, system_site_packages=False, python=None, use_sudo=False, user=None, clear=False, prompt=None, use_python='python')[source]

Require a Python virtual environment.

from fabtools import require

require.python.virtualenv('/path/to/venv')

Installing packages

fabtools.require.python.package(pkg_name, url=None, use_python='python', **kwargs)[source]

Require a Python package.

If the package is not installed, it will be installed using the pip installer.

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')
fabtools.require.python.packages(pkg_list, use_python='python', **kwargs)[source]

Require several Python packages.

fabtools.require.python.requirements(filename, use_python='python', **kwargs)[source]

Require Python packages from a pip requirements file.

fabtools.require.python.pip(version=None, use_python='python')[source]

Require pip to be installed.

fabtools.require.python.distribute(use_python='python')[source]

Require distribute to be installed.

Project Versions

Table Of Contents

Previous topic

fabtools.require.postgres

Next topic

fabtools.require.redis

This Page