在Mac 10.9.2上安装scrapy时出错。 Bugtrack_url错误

时间:2014-03-23 03:21:32

标签: python-2.7 scrapy

我正在尝试安装scrapy但是当Mac OS 10.9.2无法安装libxml2时出现错误。在libxml2上阅读了一些帖子后,我已经安装了命令行工具,但仍然没有运气。

请找出错误的堆栈

============================
sudo easy_install -U Scrapy
Searching for Scrapy
Reading http://pypi.python.org/simple/Scrapy/
Best match: Scrapy 0.22.2
Processing Scrapy-0.22.2-py2.7.egg
Scrapy 0.22.2 is already the active version in easy-install.pth
Installing scrapy script to /usr/local/bin

Using /Library/Python/2.7/site-packages/Scrapy-0.22.2-py2.7.egg
Processing dependencies for Scrapy
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Best match: lxml 3.3.3
Downloading https://pypi.python.org/packages/source/l/lxml/lxml-3.3.3.tar.gz#md5=f2675837b4358a5ecab5fd9a783fd0e5
Processing lxml-3.3.3.tar.gz
Running lxml-3.3.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-eyJrzG/lxml-3.3.3/egg-dist-tmp-LQSFBP
Building lxml version 3.3.3.
Building without Cython.
Using build configuration of libxslt 1.1.28
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
  warnings.warn(msg)
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: Setup script exited with error: command 'cc' failed with exit status 1
=============================

1 个答案:

答案 0 :(得分:0)

请尝试:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
sudo -E easy_install -U Scrapy

几乎每个easy_install / pip安装都需要在Mac OS X 10.9.2上使用这些选项,而“-E”到sudo则是将这些导出传播到超级用户环境。