---
name: "dh_virtualenv"
section: "1"
platform: "linux"
package: "dh-virtualenv"
version: "1.2.2-1.7"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/dh_virtualenv"
---

# dh\_virtualenv(1)

deploy a Python package in a self-contained virtualenv

## NAME

dh-virtualenv - deploy a Python package in a self-contained virtualenv

## SYNOPSIS

**dh\_virtualenv** \[*OPTIONS*\]

## DESCRIPTION

**dh-virtualenv** is a tool that aims to combine Debian packaging with self-contained virtualenv based Python deployments. To do this, the package extends debhelper's sequence by providing a new command in sequence, **dh\_virtualenv**, which effectively replaces following commands from the sequence:

- •

  **dh\_auto\_install**

- •

  **dh\_python2**

- •

  **dh\_pycentral**

- •

  **dh\_pysupport**

In the sequence the **dh\_virtualenv** is inserted right after **dh\_perl**.

## OPTIONS

- **-p** *PACKAGE,* **--package=***PACKAGE*

  Act on the package named PACKAGE

- **-N** *PACKAGE,* **--no-package=***PACKAGE*

  Do not act on the specified PACKAGE

- **-v, --verbose**

  Turn on verbose mode.

- **--extra-index-url**

  Pass extra index URL to pip

- **--preinstall=***PACKAGE*

  Preinstall a PACKAGE before running pip.

- **--pip-tool=***PIP\_TOOL*

  Tool used to install requirements.

- **--extra-pip-arg**

  Extra arg for the pip executable.

- **--extra-virtualenv-arg**

  Extra arg for the virtualenv executable.

- **--index-url**

  Base URL for PyPI server.

- **--setuptools**

  Use setuptools instead of distribute.

- **--install-suffix=***SUFFIX*

  Override virtualenv installation suffix

- **--upgrade-pip**

  Force upgrade pip in virtualenv

- **--requirements=***FILE*

  Use FILE for requirements

- **--setuptools-test**

  Run *setup.py test* upon build.

- **--python=***PATH*

  Use Python interpreter at PATH

- **--builtin-venv**

  Use built-in venv of Python 3

- **--skip-install**

  Don't run **pip install .**

## QUICK GUIDE FOR MAINTAINERS

- 1\.

  Build depend on *python* or *python-all* and *dh-virtualenv*

- 2\.

  Add *${python:Depends}* to Depends

- 3\.

  Add *python-virtualenv* to dh's *--with* option

## SEE ALSO

Online documentation can be found at\
  \<https://dh-virtualenv.readthedocs.io/en/latest\> .

This package should also ship with the complete documentation under */usr/share/doc/dh-virtualenv*.

## AUTHOR

Jyrki Pulliainen / Spotify AB \<jyrki@spotify.com\>

## COPYRIGHT

Copyright (C) 2013, Spotify AB. Licensed under the GNU General Public License version 2 or later
