Installing Fabric

Linux

Installing fabric on LInux/Unix machine is quite simple:

apt-get install fabric 

or

aptitude install fabric

Windows

On windows the process is a bit more complex, see: https://fabric.readthedocs.org/en/1.8/installation.html

The installation page mentions the dependencies that are required, however there are a few gotchas.

1) The PyCrypto library requires a c compiler to build from sources (or a prebuilt binary), otherwise it yields this cryptic error:

error: Unable to find vcvarsall.bat

2) fabric needs a library called ecdsa

———-

In the end these are the steps that finally worked:

  1. python 2.7 –> http://www.python.org/download/
  2. setuptools (easy_install) using ez_setup.py –> https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
  3. pip –> http://www.pip-installer.org/en/latest/installing.html
  4. PyCrypto binary —> http://www.voidspace.org.uk/python/modules.shtml#pycrypto
  5. pip: pip install ecdsa
  6. fabric : pip install fabric

Verify

We can verify the installation by running:

from fabric.api import local
def hello():
    local('echo "hello"')

Execute it:

fab -f test.py hello

Success!

Advertisements
Tagged with: ,
Posted in Fabric, Python

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: