EC2Test/WithVirtualEnv

Not logged in - Log In / Register

Using a virtualenv to access the ec2 tools

If you're unlucky enough to have problems getting utilities/ec2 to run, using a virtualenv may help.

The following should work on both Jaunty and Karmic:

# Install virtualenv.
sudo aptitude install python-virtualenv

# Create the virtual environment. This can be anywhere. It'll take
# some time to create, so you might want to put it somewhere safe.
virtualenv --python python2.5 --no-site-packages gah

# Move into the virtual env.
cd gah

# Install pip because I like it. easy_install would work fine on its
# own too I suspect.
bin/easy_install pip

# Install deps.
bin/pip install launchpadlib bzr paramiko==1.7.5 boto

# PYTHONPATH=$LP_DEVEL/lib does not work, so copy devscripts here
# (don't symlink, because we're going to edit it). LP_DEVEL is the
# path to your devel branch.
cp -r "${LP_DEVEL?}/lib/devscripts" .

# Paramiko 1.7.4 is no longer easy to get, so just hope 1.7.5 works.
sed -i 's/1[.]7[.]4/1.7.5/g' devscripts/ec2test/__init__.py

# We need the bzr-pqm plugin.
bzr branch lp:bzr-pqm
(cd bzr-pqm && ../bin/python setup.py install)

# Now it should work.
bin/python -c 'from devscripts.ec2test.entrypoint import main; main()' test $PUT_ARGS_HERE

EC2Test/WithVirtualEnv (last edited 2009-10-27 15:06:26 by allenap)