3

Fabric を正しく実行できないようです。私の問題を解決しないこの記事を見つけましたFabric Python Library to Workの取得

Homebrew を使用して Python をbrew install pythonインストールしました (これにより、PIP もインストールされます)。

実行すると、次のwhich pythonようになります。

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

次に、ファブリックをインストールしました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)

他の記事では、ファブリックが次の場所に配置されることを示唆しています/usr/local/Cellar/python/2.7.1/bin/fab

上記(ただし、私の場合は2.7.3 ls)を実行すると、次のようになります(ファブリックなし)。

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

実際のインストールは/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

私の質問は、どうすればそれを機能させることができるのですか? プロンプトで実行fabすると、次のようになります。

-bash: fab: command not found

注-私のパスは次の/etc/pathsように設定されています:

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

1 に答える 1

7

投稿したリンクは古くなっています。fabディレクトリに配置する必要があります/usr/local/share/python-HomebrewのPythonがインストールされたモジュールからスクリプトを配置する場所です。に追加/usr/local/share/pythonしますPATH

于 2012-10-30T15:10:26.117 に答える