繁体   English   中英

使用pip在Mac 10.9.1上安装Scrapy错误

[英]Installation Scrapy Error on Mac 10.9.1 using pip

我正在尝试在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

我还尝试了不带sudo的pip install scrapy ,也失败了,并出现相同的错误。

我在SO上检查了类似的问题,发现了这个

我在那里解决

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 OS的新手。 你能给点建议吗? 还是其他方便的方式来安装scrapy?

我以前使用过anaconda,但它没有刮擦功能。 我听说有一个叫做homebrew的软件包管理器。但是我不知道如何使用它。

非常感谢!

您是否看到链接的答案的更新?

在您的终端中尝试以下操作:

xcode-select --install

我尝试更新Xcode,并安装了xcode命令行。 然后安装自制软件,重新安装python,然后pip安装scrapy。 事实证明完全可以。

因此,如果遇到此类问题,并且对Mac没有太多了解,请尝试执行以下步骤:检查Xcode的版本,并使用自制程序获取pip,然后就可以了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM