Python 2.7 使用自制和PIP让织物在山狮上工作

Python 2.7 使用自制和PIP让织物在山狮上工作,python-2.7,pip,osx-mountain-lion,homebrew,fabric,Python 2.7,Pip,Osx Mountain Lion,Homebrew,Fabric,我似乎无法使布料正常运转。我发现这篇文章并不能解决我的问题 我使用自制brew安装Python安装了Python(这也安装了PIP): 运行我得到的python: /usr/local/Cellar/python/2.7.3/bin/python 然后我安装了fabricpip安装fabric Requirement already satisfied (use --upgrade to upgrade): fabric in /usr/local/lib/python2.7/site-pac

我似乎无法使布料正常运转。我发现这篇文章并不能解决我的问题

我使用自制
brew安装Python
安装了Python(这也安装了PIP):

运行
我得到的python

/usr/local/Cellar/python/2.7.3/bin/python
然后我安装了fabric
pip安装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)
另一篇文章建议fabric将位于
/usr/local/ceral/python/2.7.1/bin/fab

在上面执行
ls
(但在我的例子中是2.7.3)会得到以下结果(没有结构)

我已经在
/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

你发布的链接已过时
fab
应该位于
/usr/local/share/python
目录中——这是自制的python从已安装模块中放入脚本的地方。将
/usr/local/share/python
添加到您的
路径中

您考虑过并且能够使用virtualenv吗?是的,这已经解决了它。谢谢,这很奇怪。我刚刚安装了fabric,它位于
/usr/local/lib/python2.7/site packages/
,没有
/usr/local/share/python
。这就是最近的
python
python@2
已安装软件包。
/usr/local/bin
/usr/local/sbin
/usr/bin
/bin
/usr/sbin
/sbin