本指南上依据Scrapy官网的安装指南翻译,本人使用Ubuntu和Mac均配置成功过,貌似Windows比较麻烦,还好网上有很多教程,使用Windows只好搜索一下解决方案了。
安装前准备
在正式安装之前确保你的系统已经安装了如下组件:
- Python 2.6 or 2.7(linux系统一般内置安装了python)
- OpenSSL. 除了Windows系统之外其他操作系统已内置安装 (see Platform specific installation notes)
- pip 或者 easy_install Python 包管理器
安装Scrapy
你可以使用easy_install或者pip命令来安装Scrapy
使用pip命令安装:
<span class="pln" style="color: #000000;">pip install </span><span class="typ" style="color: #660066;">Scrapy</span>
使用easy_install命令安装:
<span class="pln" style="color: #000000;">easy_install </span><span class="typ" style="color: #660066;">Scrapy</span>
如果在安装过程中报错:
** make sure the development packages of libxml2 and libxslt are installed **
则通过如下命令安装libxml2和libxslt:
<span class="pln" style="color: #000000;">sudo apt</span><span class="pun" style="color: #666600;">-</span><span class="kwd" style="color: #000088;">get</span><span class="pln" style="color: #000000;"> install libxml2</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: #000000;">dev sudo apt</span><span class="pun" style="color: #666600;">-</span><span class="kwd" style="color: #000088;">get</span><span class="pln" style="color: #000000;"> install libxslt1</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: #000000;">dev</span>
不同平台安装注意事项
Windows
可以参考一下这个教程吧,官方文档也解决不了问题
http://blog.csdn.net/playstudy/article/details/17296473
Ubuntu 9.10 以及更高版本
Don’t use the python-scrapy package provided by Ubuntu, they are typically too old and slow to catch up with latest Scrapy.
Instead, use the official Ubuntu Packages, which already solve all dependencies for you and are continuously updated with the latest bug fixes.
转载自:coding husky