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, venv_python=None, use_sudo=False, user=None, clear=False, prompt=None, virtualenv_cmd='virtualenv', pip_cmd='pip', python_cmd='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, pip_cmd='pip', python_cmd='python', **kwargs)[source]

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

Require several Python packages.

Package names are case insensitive.

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

Require Python packages from a pip requirements file.

fabtools.require.python.pip(version='1.3.1', pip_cmd='pip', python_cmd='python')[source]

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.

fabtools.require.python.setuptools(version='0.7', python_cmd='python')[source]

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.

Read the Docs v: 0.16.0
Versions
latest
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.