1.用easy_install安装pip,pip 是对 easy_install的升级。
2.sudo pip install scrapy时会报错
#include "libxml/xmlversion.h" ^ 1 error generated. error: command ‘cc‘ failed with exit status 1
注:没有命令行开发工具 执行xcode-select --install ;而我有但是目录不对,要改变目录
sudo xcode-select --switch /Applications/Xcode.app
3.解决办法
sudo C_INCLUDE_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2/libxml:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include pip install lxml
4.在执行sudo pip install scrapy,安装成功了。
原文:http://www.cnblogs.com/ylzx/p/4804171.html