Use virtualenv in production without python-dev

pip, production-environment, python, virtualenv

Solution

pip 1.4 added support for installing and building wheel package.

"Wheel" is a built, archive format that can greatly speed installation compared to building and installing from source archives.

procedure

Install/upgrade to pip 1.4. (one time only)

Install `wheel` in both dev, production server. (one time only)

pip install wheel

Build wheel package in dev server:

pip wheel --wheel-dir=/local/wheels -r requirements.txt

Transfer `/local/wheels` packages to production server.

Install packages in production server:

pip install --use-wheel --no-index --find-links=/local/wheels -r requirements.txt

Reference

See pip documentation about building and installing wheels for more detail.

Problem

I have a python web project and I use virtualenv with pip on my dev server. Some python packages require compilation, so I should have python-dev in order to pip install them. Is there a way to reproduce my requirements stack in production keeping virtualenv, but no python-dev, as I am dealing with no dev server ?

Original source