run_tests fails in venv on my setup (lucid)

Bug #880905 reported by Lorin Hochstein on 2011-10-24
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Lorin Hochstein

Bug Description

Recently, inside of a virtualenv stopped working on my setup (lucid). With git bisect, I traced it down to this commit:

commit 7eeee584ad64b5a76c029641243a8fca2c875772
Author: Mark McLoughlin <email address hidden>
Date: Thu Sep 29 15:06:54 2011 +0100

    install_venv: don't use --no-site-packages with virtualenv

    libvirt isn't listed in pip-requires because (a) it's not in PyPi and
    (b) you always want to use libvirt's python bindings that matches the
    version of libvirt installed on the system.

    Currently, running nova-compute in virtualenv fails because libvirt
    can't be imported. The --no-site-packages flag is what prevents this.
    Everything seems to work fine without it. To verify, try deleting the
    no-global-site-packages.txt from your .nova-venv.

    Change-Id: I1df5e8e3c4426ca333c2d6b5b4fa8ece144dddf3

diff --git a/tools/ b/tools/
index a137f11..912d0a2 100644
--- a/tools/
+++ b/tools/
@@ -89,7 +89,7 @@ def create_virtualenv(venv=VENV):
     virtual environment
     print 'Creating venv...',
- run_command(['virtualenv', '-q', '--no-site-packages', VENV])
+ run_command(['virtualenv', '-q', VENV])
     print 'done.'
     print 'Installing pip in virtualenv...',
     if not run_command(['tools/', 'easy_install', 'pip']).strip():

Since it's related to --no-site-packages, it's probably interfering with some package setup on my machine, but I'm not sure what packages are interfering.

Here's the error message for the package that's failing (glance). The full output is attached.

$ ./ -f -V
Cleaning virtualenv...
Creating venv... done.
Installing pip in virtualenv... done.
Installing dependencies with pip (this can take a while)...
  Running install for glance
    ERROR: Python module kombu.connection not found
    ERROR: Python module swift.common.client not found
    ERROR: Python module xattr not found
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

    error: option --single-version-externally-managed not recognized
    Complete output from command /home/lorin/nova/.nova-venv/bin/python -c "import setuptools;__file__='/home/lorin/nova/.nova-venv/build/glance/';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-Xcyxmf-record/install-record.txt --install-headers /home/lorin/nova/.nova-venv/include/site/python2.6:
    ERROR: Python module kombu.connection not found

ERROR: Python module swift.common.client not found

ERROR: Python module xattr not found

usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

   or: -c --help [cmd1 cmd2 ...]

   or: -c --help-commands

   or: -c cmd --help

error: option --single-version-externally-managed not recognized

Command /home/lorin/nova/.nova-venv/bin/python -c "import setuptools;__file__='/home/lorin/nova/.nova-venv/build/glance/';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-Xcyxmf-record/install-record.txt --install-headers /home/lorin/nova/.nova-venv/include/site/python2.6 failed with error code 1
Storing complete log in /home/lorin/.pip/pip.log
Command "tools/ pip install --upgrade -r /home/lorin/nova/tools/pip-requires" failed.

Lorin Hochstein (lorinh) wrote :
description: updated

Submitter: Jenkins
Branch: master

 status fixcommitted

commit b08bd96ce5bf290ac6198079ad2dce71e675b481
Author: Lorin Hochstein <email address hidden>
Date: Sun Oct 30 09:00:59 2011 -0400

    Optional --no-site-packages in venv

    Added a flag to to allow user to optionally install venv with --no-site-packages.

    This fixes bug 880905

    Change-Id: Ic645e0ec56c90b72fef526ebc9f55975d446e2ae

Changed in nova:
status: New → Fix Committed
Thierry Carrez (ttx) on 2011-11-09
Changed in nova:
milestone: none → essex-1
Thierry Carrez (ttx) on 2011-11-17
Changed in nova:
status: Fix Committed → Fix Released
Mark McLoughlin (markmc) on 2012-04-03
Changed in nova:
assignee: nobody → Lorin Hochstein (lorinh)
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-1 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments