无法使用easy_install或pip在我的Mac上安装scrapy

时间:2014-03-20 04:59:25

标签: macos install scrapy

我正在使用sudo easy_install Scrapy尝试在我的Mac上安装Scrapy(运行Mac OS 10.9.2)。

当我收到以下错误时,安装似乎接近完成。我似乎无法弄明白。有人可以帮忙吗?

Installed /Library/Python/2.7/site-packages/cssselect-0.9.1-py2.7.egg
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-xwN2PB/lxml-3.3.3/egg-dist-tmp-CkAsXC
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

修改

使用pip install scrapy,我收到以下错误。所以这两种选择都无效

Installing collected packages: w3lib, queuelib, lxml
  Running setup.py install for w3lib
    error: could not create '/Library/Python/2.7/site-packages/w3lib': Permission denied
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip_build_zacharygallinger/w3lib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip-hXKj0S-record/install-record.txt --single-version-externally-managed --compile:
    running install

running build

running build_py

creating build

creating build/lib

creating build/lib/w3lib

copying w3lib/__init__.py -> build/lib/w3lib

copying w3lib/encoding.py -> build/lib/w3lib

copying w3lib/form.py -> build/lib/w3lib

copying w3lib/html.py -> build/lib/w3lib

copying w3lib/http.py -> build/lib/w3lib

copying w3lib/url.py -> build/lib/w3lib

copying w3lib/util.py -> build/lib/w3lib

running install_lib

creating /Library/Python/2.7/site-packages/w3lib

error: could not create '/Library/Python/2.7/site-packages/w3lib': Permission denied

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip_build_zacharygallinger/w3lib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip-hXKj0S-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip_build_zacharygallinger/w3lib
Storing debug log for failure in /Users/zacharygallinger/Library/Logs/pip.log

1 个答案:

答案 0 :(得分:3)

目前,您可以在构建之前执行以下操作来解决此问题:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

这应该通知编译器将这些错误转回警告。最终,如错误消息所示,这些将是硬错误。从长远来看,软件包维护者必须编辑软件包以不使用-mno-fused-madd

供参考:https://bitbucket.org/cffi/cffi/issue/46/unused-mno-fused-madd-clang-warnings-on-os