在Mac OS 10.9.4上安装Scrapy错误

时间:2014-09-24 17:38:56

标签: python scrapy

我正在使用mac ox 10.9.4,python 2.7.6。我正在尝试通过

安装Scrapy
  

pip install Scrapy

经过一些下载后发生以下情况:

  Running setup.py (path:/private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/pyOpenSSL/setup.py) egg_info for package pyOpenSSL

    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    no previously-included directories found matching 'doc/_build'
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in ./anaconda/lib/python2.7/site-packages (from Scrapy)
Downloading/unpacking queuelib (from Scrapy)
  Downloading queuelib-1.2.2-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): lxml in ./anaconda/lib/python2.7/site-packages (from Scrapy)
Downloading/unpacking w3lib>=1.8.0 (from Scrapy)
  Downloading w3lib-1.10.0-py2.py3-none-any.whl
Downloading/unpacking cssselect>=0.9 (from Scrapy)
  Downloading cssselect-0.9.1.tar.gz
  Running setup.py (path:/private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/cssselect/setup.py) egg_info for package cssselect

    no previously-included directories found matching 'docs/_build'
Downloading/unpacking Twisted>=10.0.0 (from Scrapy)
  Downloading Twisted-14.0.2.tar.bz2 (4.3MB): 4.3MB downloaded
  Running setup.py (path:/private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/Twisted/setup.py) egg_info for package Twisted

Downloading/unpacking cryptography>=0.2.1 (from pyOpenSSL->Scrapy)
  Downloading cryptography-0.5.4.tar.gz (320kB): 320kB downloaded
  Running setup.py (path:/private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/cryptography/setup.py) egg_info for package cryptography
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/cryptography/setup.py", line 174, in <module>
        "test": PyTest,
      File "/Users/nereus/anaconda/lib/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/dist.py", line 239, in __init__
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/dist.py", line 264, in fetch_build_eggs
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/pkg_resources.py", line 580, in resolve
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/pkg_resources.py", line 818, in best_match
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/pkg_resources.py", line 830, in obtain
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/dist.py", line 314, in fetch_build_egg
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 593, in easy_install
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 623, in install_item
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 809, in install_eggs
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 1015, in build_and_install
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 1000, in run_setup
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/sandbox.py", line 50, in run_setup
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/sandbox.py", line 100, in run
      File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/sandbox.py", line 52, in <lambda>
      File "setup.py", line 86, in <module>

      File "setup.py", line 49, in ask_supports_thread
        "iso8601",
      File "/Users/nereus/anaconda/lib/python2.7/distutils/command/config.py", line 230, in try_compile
        self._check_compiler()
      File "/Users/nereus/anaconda/lib/python2.7/distutils/command/config.py", line 103, in _check_compiler
        customize_compiler(self.compiler)
      File "/Users/nereus/anaconda/lib/python2.7/distutils/sysconfig.py", line 170, in customize_compiler
        _osx_support.customize_compiler(_config_vars)
      File "/Users/nereus/anaconda/lib/python2.7/_osx_support.py", line 418, in customize_compiler
        _find_appropriate_compiler(_config_vars)
      File "/Users/nereus/anaconda/lib/python2.7/_osx_support.py", line 185, in _find_appropriate_compiler
        if 'llvm-gcc' in data:
    TypeError: argument of type 'NoneType' is not iterable
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/cryptography/setup.py", line 174, in <module>

    "test": PyTest,

  File "/Users/nereus/anaconda/lib/python2.7/distutils/core.py", line 112, in setup

    _setup_distribution = dist = klass(attrs)

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/dist.py", line 239, in __init__

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/dist.py", line 264, in fetch_build_eggs

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/pkg_resources.py", line 580, in resolve

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/pkg_resources.py", line 818, in best_match

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/pkg_resources.py", line 830, in obtain

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/dist.py", line 314, in fetch_build_egg

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 593, in easy_install

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 623, in install_item

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 809, in install_eggs

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 1015, in build_and_install

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/command/easy_install.py", line 1000, in run_setup

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/sandbox.py", line 50, in run_setup

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/sandbox.py", line 100, in run

  File "/Users/nereus/anaconda/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg/setuptools/sandbox.py", line 52, in <lambda>

  File "setup.py", line 86, in <module>



  File "setup.py", line 49, in ask_supports_thread

    "iso8601",

  File "/Users/nereus/anaconda/lib/python2.7/distutils/command/config.py", line 230, in try_compile

    self._check_compiler()

  File "/Users/nereus/anaconda/lib/python2.7/distutils/command/config.py", line 103, in _check_compiler

    customize_compiler(self.compiler)

  File "/Users/nereus/anaconda/lib/python2.7/distutils/sysconfig.py", line 170, in customize_compiler

    _osx_support.customize_compiler(_config_vars)

  File "/Users/nereus/anaconda/lib/python2.7/_osx_support.py", line 418, in customize_compiler

    _find_appropriate_compiler(_config_vars)

  File "/Users/nereus/anaconda/lib/python2.7/_osx_support.py", line 185, in _find_appropriate_compiler

    if 'llvm-gcc' in data:

TypeError: argument of type 'NoneType' is not iterable

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/6w/2xcgzk1512l1bnhsylw571y40000gn/T/pip_build_nereus/cryptography
Storing debug log for failure in /Users/nereus/.pip/pip.log

有人可以帮我解决一下吗?

非常感谢你。

2 个答案:

答案 0 :(得分:0)

您是否安装了xcode命令行工具?尝试运行此命令:

xcode-select --install

答案 1 :(得分:0)

我发现使用anaconda更容易。首先安装。那么你可以做到 conda安装scrapy

anaconda是一个全功能的python发行版,是自包含的。