Skip to content

Debian Ubuntu Installation Notes (Python virtualenv)

Arushit Mudgal edited this page Apr 15, 2018 · 1 revision

Overview: running Thug in Python virtualenv on Debian Wheezy

Some users may wish to operate Thug from a Python virtual environment. This can be accomplished easily under Debian testing (at time of writing, Wheezy), which includes a default Python 2.7 environment.

An overview of setup steps follows, based on the setup instructions for Thug:

  1. Install packages: build-essential subversion git unzip graphviz autoconf libtool mongodb rabbitmq-server python-pip python-dev libboost-python-dev (Apt)
  2. Install virtualenvwrapper (pip)
  3. Create python 2.7 virtualenv for Thug
  4. Install v8/pyv8 in virtualenv (source builds)
  5. Install libemu from Git (source build) - see below note
  6. Install pylibemu in virtualenv (source build)
  7. Install remaining Python libraries via requirements file in virtualenv (pip)

Note: author notes that attempting to build libemu from the latest release tarball failed at configure script under Wheezy with the following error:

$ ./configure
...
checking size of long... configure: error: cannot compute sizeof (long)

Building from a Git checkout succeeds, however.

The following requirements file works for installing Python module dependencies with pip:

# dependencies for thug on Debian Wheezy in virtualenv
beautifulsoup4
html5lib
pefile
chardet
httplib2
boost
cssutils
zope.interface
# pinned to Python 2.x compatible release
pyparsing==1.5.7
pydot
python-magic
pymongo
pika

After setup, Thug executes from the Python virtual environment:

$ ~/venv.d/thug/bin/python ~/devel/thug/thug-master/src/thug.py -V
Thug 0.4.21