Scrapy Install Failure

Sytem Notes : OS X 10.11.1
python version: 2.7.6

When attempting to install Srapy (python based web spider library), I received the following error.

>>>pip install scrapy

...
1 error generated.
Compile failed: command 'gcc' failed with exit status 1
creating var
creating var/folders
creating var/folders/fr
creating var/folders/fr/xy474w2n7212f9pnc3vyf8nxv3qrhw
creating var/folders/fr/xy474w2n7212f9pnc3vyf8nxv3qrhw/T
cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /var/folders/fr/xy474w2n7212f9pnc3vyf8nxv3qrhw/T/xmlXPathInitRqETjP.c -o var/folders/fr/xy474w2n7212f9pnc3vyf8nxv3qrhw/T/xmlXPathInitRqETjP.o
/var/folders/fr/xy474w2n7212f9pnc3vyf8nxv3qrhw/T/xmlXPathInitRqETjP.c:1:10: fatal error: 'libxml/xpath.h' file not found
#include "libxml/xpath.h"
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?

However the helpful hint at the bottom corrected the issue.

Perhaps try: xcode-select --install 

When in the Terminal I ran the suggested command.

>>>xcode-select --install

An Xcode installer started up and after following the prompt the Xcode command line tools completed successfully.
I tried the Srapy install again using pip and it was actually successful!

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*