我已经尝试了两天来解决这个问题。我有最新版本的 OSX 和 Homebrew。我遵循了一个教程,让我通过 Homebrew 安装 pip,然后建议从 Homebrew 安装 Fabric:
brew install Fabric
但是 Fabric 的公式已经从 Homebrew 中消失了。是的,我也进行了更新。所以我遵循了另一个建议我通过 pip 安装的教程。 pip 安装结构
它在涉及 pycrypto 的各种方面都失败了。这是点日志。 Mac 不应该让生活变得更轻松吗?
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip-1.4-py2.7.egg/pip/commands/install.py", line 241, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/local/lib/python2.7/site-packages/pip-1.4-py2.7.egg/pip/req.py", line 1277, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pip-1.4-py2.7.egg/pip/req.py", line 622, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/usr/local/lib/python2.7/site-packages/pip-1.4-py2.7.egg/pip/util.py", line 670, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/local/opt/python/bin/python2.7 -c "import setuptools;__file__='/private/tmp/pip-build-root/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-DDW_Gb-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/tmp/pip-build-root/pycrypto
最佳答案
原来如此:
pip install fabric
它以前对我不起作用,因为我使用的是 Mac OSX,没有人告诉我我必须安装命令行工具
才能真正对 Mac 执行任何有用的操作(这确实应该)需要强调的是,由于编译错误,我直到 12 月才最终安装 Fabric,直到我安装了这些工具。
关于macos - 无法使用推荐的 Homebrew 和 pip 在 OSX 上安装 Fabric。 Xcode 是最新版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18307952/