lunatechian (lunatech-ian)

one relating to, belonging to, or resembling lunatech

Faster setup of virtualenv with devpi

Setting up the virtualenv can take a significant amount of time because it pulls down packages from PyPI. I was surprised that it does not try to use the locally installed packages. One way to speed up the rebuild is to use a local caching mirror of PyPI. This can be accomplished by using devpi.

Step 1: Install devpi package

sudo pip install devpi

Step 2: Add the following lines in your /root/.pip/pip.conf file

index-url  = http://localhost:3141/root/pypi/+simple/
extra-index-url  =

From now on, pip will first try to get the package from devpi-server running on your localhost first and if you do not have devpi-server running, will fallback to .

Step 3: Start the devpi-server on your localhost: devpi-server. Try installing a few packages or build a virtualenv. The command devpi-server -start will start the server and put it in background.

TODO - figure out how to start this from init.