【问题标题】:Installation Scrapy Error on Mac 10.9.1 using pip使用 pip 在 Mac 10.9.1 上安装 Scrapy 错误
【发布时间】:2014-03-02 13:11:59
【问题描述】:

我正在尝试在 mac os 10.9.1 上安装 scrapy

sudo pip install scrapy

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/include/libxml2 -I/private/var/folders/k6/g5dx4fj91tdf6f4_28p6fh980000gn/T/pip_build_tommy/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace

xcrun: error: active developer path ("/Developer") does not exist, use xcode-select to change

error: command 'cc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/k6/g5dx4fj91tdf6f4_28p6fh980000gn/T/pip_build_tommy/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/k6/g5dx4fj91tdf6f4_28p6fh980000gn/T/pip-BlN0gM-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/k6/g5dx4fj91tdf6f4_28p6fh980000gn/T/pip_build_tommy/lxml

Storing debug log for failure in /Users/tommy/Library/Logs/pip.log

我也试过pip install scrapy 没有sudo,也失败了同样的错误。

我在S.O上查了类似的问题,发现this

我在那里遵循了解决方案

ln -s  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 /usr/local/include/X11

没有这样的文件或目录。

我是 Mac 操作系统的新手。你能给点建议吗?或者其他方便的方式来安装scrapy?

我以前用过 anaconda,但它没有整合 scrapy。我听说有一个包管理器叫 homebrew..但我不知道如何使用它。

非常感谢!

【问题讨论】:

    标签: python macos scrapy


    【解决方案1】:

    你看到你链接的答案的更新了吗?

    在你的终端试试这个:

    xcode-select --install
    

    【讨论】:

      【解决方案2】:

      我尝试更新我的 Xcode,并安装了 xcode 命令行。 然后安装 homebrew,重新安装 python,然后 pip install scrapy。结果完全没问题。

      所以如果你有这样的问题,而且你对mac的了解不多,试试看你的Xcode版本,用homebrew获取pip,就OK了。

      【讨论】:

        猜你喜欢
        • 2017-04-05
        • 1970-01-01
        • 1970-01-01
        • 2014-02-03
        • 2014-08-21
        • 2017-03-04
        • 2016-10-12
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多