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.
Here's the failing output. 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.
$ ./run_tests.sh -f -V
Cleaning virtualenv...
done.
Creating venv... done.
Installing pip in virtualenv... done.
Installing dependencies with pip (this can take a while)...
...
Running setup.py 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/setup.py';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
Recently, run_tests.sh inside of a virtualenv stopped working on my setup (lucid). With git bisect, I traced it down to this commit:
commit 7eeee584ad64b5a 76c029641243a8f ca2c875772
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 global- site-packages. txt from your .nova-venv.
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-
Change-Id: I1df5e8e3c4426c a333c2d6b5b4fa8 ece144dddf3
diff --git a/tools/ install_ venv.py b/tools/ install_ venv.py install_ venv.py install_ venv.py virtualenv( venv=VENV) : ['virtualenv' , '-q', '--no-site- packages' , VENV]) ['virtualenv' , '-q', VENV]) ['tools/ with_venv. sh', 'easy_install', 'pip']).strip():
index a137f11..912d0a2 100644
--- a/tools/
+++ b/tools/
@@ -89,7 +89,7 @@ def create_
virtual environment
"""
print 'Creating venv...',
- run_command(
+ run_command(
print 'done.'
print 'Installing pip in virtualenv...',
if not run_command(
Here's the failing output. 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.
$ ./run_tests.sh -f -V
Cleaning virtualenv...
done.
Creating venv... done.
Installing pip in virtualenv... done.
Installing dependencies with pip (this can take a while)...
...
Running setup.py 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 nova/.nova- venv/bin/ python -c "import setuptools; __file_ _='/home/ lorin/nova/ .nova-venv/ build/glance/ setup.py' ;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:
Complete output from command /home/lorin/
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
------- ------- ------- ------- ------- ----- nova/.nova- venv/bin/ python -c "import setuptools; __file_ _='/home/ lorin/nova/ .nova-venv/ build/glance/ setup.py' ;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 .pip/pip. log nova/tools/ pip-requires" failed.
Command /home/lorin/
Storing complete log in /home/lorin/
Command "tools/with_venv.sh pip install --upgrade -r /home/lorin/