views:

353

answers:

3

Just installed fabric, trying to use to same fabfile that works on a different server, getting this error here:

Traceback (most recent call last):
  File "/var/lib/python-support/python2.6/fabric.py", line 1211, in main
    load(fabfile, fail='warn')
  File "/var/lib/python-support/python2.6/fabric.py", line 467, in load
    execfile(filename)
  File "fabfile.py", line 2, in <module>
    from fabric.api import *
ImportError: No module named api
+1  A: 

Looks like you have different versions of Fabric on those servers, they changed the module structure recently.

Alex Lebedev
A: 

I just got this message on my Ubuntu 9.10 machine; Ubuntu ships with an old version of fabric (0.1.1). The latest release version is 0.9.0.

sudo easy_install fabric

should get you the latest released version.

Ian Clelland
A: 

I had this problem when I installed fabric using disutils on OS X. So I removed it and reinstalled with pip. works fine.

To remove: Delete the Fabric egg in site-packages directory.

then install using pip

sudo pip install fabric
rubayeet