无法安装Scrapy - 在cffi 0.8.6期间找不到工作编译器

时间:2014-12-30 03:37:41

标签: python-2.7 scrapy osx-leopard

我试图安装Scrapy,但它失败了,我无法弄清楚要做什么。我是命令行和python的新手。由于没有编译cffi的包,它似乎失败了。我正在运行Mac OSx 10.5.8。已安装Xcode 3.0版。

有没有人知道为什么会失败或者我能做些什么呢?谢谢!

-Matt

这是我尝试使用pip安装时的输出:

$ pip install scrapy
Downloading/unpacking scrapy
  Downloading Scrapy-0.24.4-py2-none-any.whl (444kB): 444kB downloaded
Downloading/unpacking pyOpenSSL (from scrapy)
  Downloading pyOpenSSL-0.14.tar.gz (128kB): 128kB downloaded
  Running setup.py (path:/private/var/folders/gY/gYFQRMkVEYeji6ED8rcjFE+++TI/-Tmp-/pip_build_Farrell/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'
Downloading/unpacking six>=1.5.2 (from scrapy)
  Downloading six-1.8.0-py2.py3-none-any.whl
Downloading/unpacking queuelib (from scrapy)
  Downloading queuelib-1.2.2-py2.py3-none-any.whl
Downloading/unpacking lxml (from scrapy)
  Downloading lxml-3.4.1.tar.gz (3.5MB): 3.5MB downloaded
  Running setup.py (path:/private/var/folders/gY/gYFQRMkVEYeji6ED8rcjFE+++TI/-Tmp-/pip_build_Farrell/lxml/setup.py) egg_info for package lxml
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.1.
    Building without Cython.
    Using build configuration of libxslt 1.1.12
    Minimum required version of libxslt is 1.1.12, found 1.1.23
    Building against libxml2/libxslt in the following directory: /usr/lib

    warning: no previously-included files found matching '*.py'
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/gY/gYFQRMkVEYeji6ED8rcjFE+++TI/-Tmp-/pip_build_Farrell/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/gY/gYFQRMkVEYeji6ED8rcjFE+++TI/-Tmp-/pip_build_Farrell/Twisted/setup.py) egg_info for package Twisted

Downloading/unpacking cryptography>=0.2.1 (from pyOpenSSL->scrapy)
  Downloading cryptography-0.7.1.tar.gz (247kB): 247kB downloaded
  Running setup.py (path:/private/var/folders/gY/gYFQRMkVEYeji6ED8rcjFE+++TI/-Tmp-/pip_build_Farrell/cryptography/setup.py) egg_info for package cryptography

    no previously-included directories found matching 'docs/_build'
    warning: no previously-included files matching '*' found under directory 'vectors'
Downloading/unpacking zope.interface>=3.6.0 (from Twisted>=10.0.0->scrapy)
  Downloading zope.interface-4.1.2.tar.gz (919kB): 919kB downloaded
  Running setup.py (path:/private/var/folders/gY/gYFQRMkVEYeji6ED8rcjFE+++TI/-Tmp-/pip_build_Farrell/zope.interface/setup.py) egg_info for package zope.interface

    warning: no previously-included files matching '*.dll' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.pyo' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
Downloading/unpacking cffi>=0.8 (from cryptography>=0.2.1->pyOpenSSL->scrapy)
  Downloading cffi-0.8.6.tar.gz (196kB): 196kB downloaded
  Running setup.py (path:/private/var/folders/gY/gYFQRMkVEYeji6ED8rcjFE+++TI/-Tmp-/pip_build_Farrell/cffi/setup.py) egg_info for package cffi
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/private/var/folders/gY/gYFQRMkVEYeji6ED8rcjFE+++TI/-Tmp-/pip_build_Farrell/cffi/setup.py", line 86, in <module>
        ask_supports_thread()
      File "/private/var/folders/gY/gYFQRMkVEYeji6ED8rcjFE+++TI/-Tmp-/pip_build_Farrell/cffi/setup.py", line 49, in ask_supports_thread
        ok = config.try_compile('__thread int some_threadlocal_variable_42;')
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/config.py", line 230, in try_compile
        self._check_compiler()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/config.py", line 103, in _check_compiler
        customize_compiler(self.compiler)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/sysconfig.py", line 171, in customize_compiler
        _osx_support.customize_compiler(_config_vars)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.py", line 418, in customize_compiler
        _find_appropriate_compiler(_config_vars)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.py", line 191, in _find_appropriate_compiler
        "Cannot locate working compiler")
    SystemError: Cannot locate working compiler
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

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

  File "/private/var/folders/gY/gYFQRMkVEYeji6ED8rcjFE+++TI/-Tmp-/pip_build_Farrell/cffi/setup.py", line 86, in <module>

    ask_supports_thread()

  File "/private/var/folders/gY/gYFQRMkVEYeji6ED8rcjFE+++TI/-Tmp-/pip_build_Farrell/cffi/setup.py", line 49, in ask_supports_thread

    ok = config.try_compile('__thread int some_threadlocal_variable_42;')

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/config.py", line 230, in try_compile

    self._check_compiler()

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/config.py", line 103, in _check_compiler

    customize_compiler(self.compiler)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/sysconfig.py", line 171, in customize_compiler

    _osx_support.customize_compiler(_config_vars)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.py", line 418, in customize_compiler

    _find_appropriate_compiler(_config_vars)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.py", line 191, in _find_appropriate_compiler

    "Cannot locate working compiler")

SystemError: Cannot locate working compiler

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/gY/gYFQRMkVEYeji6ED8rcjFE+++TI/-Tmp-/pip_build_Farrell/cffi
Storing debug log for failure in /Users/Farrell/.pip/pip.log

编辑:这是我尝试brew install python&#39;时的结果:

$ brew install python

错误:/usr/local/Library/Formula/openssl.rb:128:语法错误,意外&#39;,&#39;,期待kEND 请报告此错误:     http://git.io/brew-troubleshooting /usr/local/Library/Homebrew/formulary.rb:65:require' /usr/local/Library/Homebrew/formulary.rb:65:in klass&#39; /usr/local/Library/Homebrew/formulary.rb:50:get_formula' /usr/local/Library/Homebrew/formulary.rb:198:in工厂&#39; /usr/local/Library/Homebrew/dependency.rb:32:in to_formula' /usr/local/Library/Homebrew/dependency.rb:88:in展开&#39; /usr/local/Library/Homebrew/dependencies.rb:9:in each' /usr/local/Library/Homebrew/dependencies.rb:9:in每个&#39; /usr/local/Library/Homebrew/dependency.rb:76:in expand' /usr/local/Library/Homebrew/formula.rb:501:in recursive_dependencies&#39; /usr/local/Library/Homebrew/formula_installer.rb:98:in verify_deps_exist' /usr/local/Library/Homebrew/formula_installer.rb:91:in前奏&#39; /usr/local/Library/Homebrew/cmd/install.rb:144:in install_formula' /usr/local/Library/Homebrew/cmd/install.rb:67:in安装&#39; /usr/local/Library/Homebrew/cmd/install.rb:67:in each' /usr/local/Library/Homebrew/cmd/install.rb:67:in安装&#39; /usr/local/Library/brew.rb:136:in`send&39; /usr/local/Library/brew.rb:136

1 个答案:

答案 0 :(得分:0)

您可能错过了brew install python

您可以查看http://docs.python-guide.org/en/latest/starting/install/osx/

中的更多详情