Navigation

Fabric is best installed via pip (highly
recommended) or easy_install (older, but still works
fine). You may also opt to use your operating system’s package manager (the
package is typically called fabric or python-fabric), or execute
pythonsetup.pyinstall inside a downloaded or
cloned copy of the source code.

Fabric requires Python version 2.5 or 2.6. Some caveats
and notes about other Python versions:

We are not planning on supporting Python 2.4 given its age and the number
of useful tools in Python 2.5 such as context managers and new modules.
That said, the actual amount of 2.5-specific functionality is not
prohibitively large, and we would link to – but not support – a third-party
2.4-compatible fork. (No such fork exists at this time, to our knowledge.)

Fabric has not yet been tested on Python 3.x and is thus likely to be
incompatible with that line of development. However, we try to be at least
somewhat forward-looking (e.g. using print() instead of print) and
will definitely be porting to 3.x in the future once our dependencies do.

Setuptools comes with some Python installations by default; if yours doesn’t,
you’ll need to grab it. In such situations it’s typically packaged as
python-setuptools, py25-setuptools or similar. Fabric may drop its
setuptools dependency in the future, or include alternative support for the
Distribute project, but for now setuptools is required for installation.

PyCrypto is a dependency of
Paramiko which provides the low-level (C-based) encryption algorithms used to
run SSH. There are a couple gotchas associated with installing PyCrypto: its
compatibility with Python’s package tools, and the fact that it is a C-based
extension.

We strongly recommend using pip to install Fabric as it is newer and
generally better than easy_install. However, a combination of bugs in
specific versions of Python, pip and PyCrypto can prevent installation of
PyCrypto. Specifically:

Python = 2.5.x

PyCrypto >= 2.1

pip < 0.8.1

When all three criteria are met, you may encounter Nosuchfileordirectory IOErrors when trying to pipinstallFabric or pipinstallPyCrypto.

The fix is simply to make sure at least one of the above criteria is not met,
by doing the following (in order of preference):

Upgrade to pip 0.8.1 or above, e.g. by running pipinstall-Upip.

Explicitly install PyCrypto 2.0.1 (which is the latest version known to work with
Fabric which does not cause the installation problem) via pipinstallPyCrypto==2.0.1.

Unless you are installing from a precompiled source such as a Debian apt
repository or RedHat RPM, or using pypm, you will also need the
ability to build Python C-based modules from source in order to install
PyCrypto. Users on Unix-based platforms such as Ubuntu or Mac OS X will
need the traditional C build toolchain installed (e.g. Developer Tools / XCode
Tools on the Mac, or the build-essential package on Ubuntu or Debian Linux
– basically, anything with gcc, make and so forth) as well as the
Python development libraries, often named python-dev or similar.

Some Windows users whose Python is 64-bit have found that the PyCrypto
dependency winrandom may not install properly, leading to ImportErrors.
In this scenario, you’ll probably need to compile winrandom yourself
via e.g. MS Visual Studio. See #194 for info.

For an up-to-date list of exact testing/development requirements, including
version numbers, please see the requirements.txt file included with the
source distribution. This file is intended to be used with pip, e.g. pipinstall-rrequirements.txt.

To obtain a tar.gz or zip archive of the Fabric source code, you may visit
either of the following locations:

The official downloads are located on our Github account’s Downloads page. This is the spot you want to
download from for operating system packages, as the only changing part of the
URL will be the filename itself and the md5 hashes will be consistent.

Our Git repository viewer provides downloads of
all tagged releases. See the “Download” column, next to the “Tag” column in
the middle of the front page. Please note that due to how cgit generates tag
archives, the md5 sums will change over time, so use of this location for
package downloads is not recommended.

Fabric’s PyPI page offers manual
downloads in addition to being the entry point for pip and
easy-install.

Make your own fork of the Github repository by making a Github account,
visiting GitHub/fabric/fabric
and clicking the “fork” button.

Note

If you’ve obtained the Fabric source via source control and plan on
updating your checkout in the future, we highly suggest using pythonsetup.pydevelop instead – it will use symbolic links instead of file
copies, ensuring that imports of the library or use of the command-line
tool will always refer to your checkout.

For information on the hows and whys of Fabric development, including which
branches may be of interest and how you can help out, please see the
Development page.

Windows users who already have ActiveState’s ActivePython distribution installed
may find Fabric is best installed with its package manager, PyPM. Below is example output from an
installation of Fabric 0.9.4 via pypm: