Reputation: 1995
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
Upvotes: 2
Views: 6847
Reputation: 1801
Your problem is that you named a file fabric.py somewhere in your python path. (probably in your current working directory) Rename it to something else and then it will not have any issues. I accidentally do this all the time and it is annoying.
Upvotes: 3
Reputation: 9400
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
Upvotes: 0
Reputation: 44122
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.
Upvotes: 0
Reputation: 6044
Looks like you have different versions of Fabric on those servers, they changed the module structure recently.
Upvotes: 1