darronz
darronz

Reputation: 903

Getting Fabric to work on Mountain Lion using Homebrew and PIP

I can't seem to get Fabric running correctly. I found this article which doesn't solve the issue for me Getting Fabric Python Library to Work

I installed Python using Homebrew brew install python (this also installs PIP):

Running which python I get:

/usr/local/Cellar/python/2.7.3/bin/python

I then installed fabric pip install fabric

Requirement already satisfied (use --upgrade to upgrade): fabric in /usr/local/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): ssh>=1.7.14 in /usr/local/lib/python2.7/site-packages (from fabric)
Requirement already satisfied (use --upgrade to upgrade): pycrypto>=2.1,!=2.4 in /usr/local/lib/python2.7/site-packages (from ssh>=1.7.14->fabric)

The other article suggests that fabric will be located at /usr/local/Cellar/python/2.7.1/bin/fab

Doing an ls on the above (but 2.7.3 in my case) gets the following (no fabric).

lrwxr-xr-x   1 darron  staff   80 Oct 26 17:37 2to3 -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/2to3
lrwxr-xr-x   1 darron  staff   82 Oct 26 17:37 2to3-2 -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/2to3-2
lrwxr-xr-x   1 darron  staff   84 Oct 26 17:37 2to3-2.7 -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/2to3-2.7
-r-xr-xr-x   1 darron  staff  422 Oct 26 17:37 easy_install
-r-xr-xr-x   1 darron  staff  430 Oct 26 17:37 easy_install-2.7
lrwxr-xr-x   1 darron  staff   80 Oct 26 17:37 idle -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/idle
lrwxr-xr-x   1 darron  staff   81 Oct 26 17:37 idle2 -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/idle2
lrwxr-xr-x   1 darron  staff   83 Oct 26 17:37 idle2.7 -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/idle2.7
-r-xr-xr-x   1 darron  staff  380 Oct 26 17:37 pip
-r-xr-xr-x   1 darron  staff  388 Oct 26 17:37 pip-2.7
lrwxr-xr-x   1 darron  staff   81 Oct 26 17:37 pydoc -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/pydoc
lrwxr-xr-x   1 darron  staff   82 Oct 26 17:37 pydoc2 -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/pydoc2
lrwxr-xr-x   1 darron  staff   84 Oct 26 17:37 pydoc2.7 -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/pydoc2.7
lrwxr-xr-x   1 darron  staff   82 Oct 26 17:37 python -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/python
lrwxr-xr-x   1 darron  staff   89 Oct 26 17:37 python-config -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/python-config
lrwxr-xr-x   1 darron  staff   83 Oct 26 17:37 python2 -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/python2
lrwxr-xr-x   1 darron  staff   90 Oct 26 17:37 python2-config -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/python2-config
lrwxr-xr-x   1 darron  staff   85 Oct 26 17:37 python2.7 -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x   1 darron  staff   92 Oct 26 17:37 python2.7-config -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
lrwxr-xr-x   1 darron  staff   83 Oct 26 17:37 pythonw -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/pythonw
lrwxr-xr-x   1 darron  staff   84 Oct 26 17:37 pythonw2 -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/pythonw2
lrwxr-xr-x   1 darron  staff   86 Oct 26 17:37 pythonw2.7 -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
lrwxr-xr-x   1 darron  staff   84 Oct 26 17:37 smtpd.py -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/smtpd.py
lrwxr-xr-x   1 darron  staff   87 Oct 26 17:37 smtpd2.7.py -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/smtpd2.7.py
lrwxr-xr-x   1 darron  staff   85 Oct 26 17:37 smtpd2.py -> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/smtpd2.py

I've located the actual install at /usr/local/lib/python2.7/site-packages

drwxr-xr-x  14 darron  staff   476 Oct 26 17:41 Crypto
drwxr-xr-x   9 darron  staff   306 Oct 26 17:41 Fabric-1.4.3-py2.7.egg-info
drwxr-xr-x  10 darron  staff   340 Oct 26 17:37 distribute-0.6.28-py2.7.egg
-rw-r--r--   1 darron  staff   237 Oct 26 17:37 easy-install.pth
drwxr-xr-x  10 darron  staff   340 Oct 26 17:41 fabfile
drwxr-xr-x  41 darron  staff  1394 Oct 26 17:41 fabric
drwxr-xr-x   7 darron  staff   238 Oct 22 08:13 git_remote_helpers
lrwxr-xr-x   1 darron  staff    93 Oct 22 08:13 git_remote_helpers-0.1.0-py2.7.egg-info -> ../../../Cellar/git/1.8.0/lib/python2.7/site-packages/git_remote_helpers-0.1.0-py2.7.egg-info
drwxr-xr-x   4 darron  staff   136 Oct 26 17:37 pip-1.2.1-py2.7.egg
drwxr-xr-x   7 darron  staff   238 Oct 26 17:41 pycrypto-2.6-py2.7.egg-info
-rw-r--r--   1 darron  staff   144 Oct 26 17:37 setuptools-0.6c11-py2.7.egg-info
-rw-r--r--   1 darron  staff    34 Oct 26 17:37 setuptools.pth
-rw-r--r--   1 darron  staff  1224 Oct 26 17:37 sitecustomize.py
-rw-r--r--   1 darron  staff   600 Oct 26 17:37 sitecustomize.pyc
drwxr-xr-x  72 darron  staff  2448 Oct 26 17:41 ssh
drwxr-xr-x   8 darron  staff   272 Oct 26 17:41 ssh-1.7.14-py2.7.egg-info

My question is how do I get it working? Running fab at the prompt gets me:

-bash: fab: command not found

Note - my paths are set in /etc/paths like so:

/usr/local/bin
/usr/local/sbin
/usr/bin
/bin
/usr/sbin
/sbin

Upvotes: 3

Views: 3130

Answers (1)

mipadi
mipadi

Reputation: 410742

The link you posted is outdated. fab should be located in the /usr/local/share/python directory -- that's where Homebrew's Python puts scripts from installed modules. Add /usr/local/share/python to your PATH.

Upvotes: 7

Related Questions