簡體   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