您的位置:首页 > 其它

Mac下安装爬虫框架Scrapy

2015-07-01 15:18 330 查看


Mac下安装爬虫框架Scrapy

发表于 2014-04-25   |   分类于 开发  
|   暂无评论

刚刚试了下可以,可以简化为下面三个步骤
一、删除Mac自带的Python

sudo rm -rf /usr/bin/python

二、homebrew安装最新的Python

brew install python

创建一个软链接

sudo ln -s /usr/local/bin/python /usr/bin/python

三、使用pip安装scrapy

使用homebrew安装完python后会自动安装好包管理工具pip,所以执行下面安装命令

pip install scrapy

安装完成后如下所示

machaismile$ scrapy
Scrapy 0.22.2 - no active project

Usage:
scrapy <command> [options] [args]

Available commands:
bench         Run quick benchmark test
fetch         Fetch a URL using the Scrapy downloader
runspider     Run a self-contained spider (without creating a project)
settings      Get settings values
shell         Interactive scraping console
startproject  Create new project
version       Print Scrapy version
view          Open URL in browser, as seen by Scrapy

[ more ]      More commands available when run from project directory

Use "scrapy <command> -h" to see more info about a command

出现 zsh: command not found: scrapy 执行
 ln -s  /Library/Frameworks/Python.framework/Versions/2.7/bin/scrapy /usr/local/bin/scrapy
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: