1

I have a ubuntu LTS server. On boot I run a script which does the following:

#!/bin/bash
apt-get -y install build-essential python-dev libxml2-dev libxslt1-dev
apt-get -y install python-pip python-virtualenv                                      
mkdir /etc/test/venv
virtualenv /etc/test/venv
. /etc/test/venv/bin/activate
pip install -r /etc/test/requirements.txt
cd /etc/test/utilities/                             
chmod +x worker.py                                     
./worker.py &                                          
exit 0

I know that this executes ok. In my requirements.txt I have the following:

boto
scrapy

Then in my worker.py it starts with this code:

#!/usr/bin/env python
import logging
import boto.swf.layer2 as swf

The error I get is:

Import Error: No module named boto.swf.layer2

I don't know where to start understanding what is going wrong. Is it a path error, or is boto not being installed correctly?

J.Zil
  • 1,123
  • 3
  • 21
  • 29

1 Answers1

3

You probably have an old version of boto pre-installed on your AMI that doesn't have SWF Layer 2 support yet.

Check by typing this into a shell:

python -c "import boto; print boto.Version"

I think SWF Layer 2 was added in release 2.7, anything before that won't work. Here's the commit adding Layer2 to SWF

Your easiest option is to add -U to your pip command so it updates your packages if they're already installed:

pip install -U -r /etc/test/requirements.txt
Raph P
  • 46
  • 1