按照官方文档的说明,安装Scrapy 需要以下程序或者库:
(1)Python 2.7
(2)lxml. Most linux distributions ships PRepackaged versions of lxml. Otherwise refer to http://lxml.de/installation.html
(3)OpenSSL. This comes preinstalled in all Operating systems except Windows (see Platform specific installation notes)
(4)pip or easy_install Python package managers
我们安装的Ubuntu14.04系统都已经自带了前面3个,Python的版本为2.7.6。为了验证是否有安装,我们来查看一下。
打开终端,执行如下命令python, 接下来就是import lxml, import OpenSSL。如下图。
(1)Python 2.7
(2)lxml. Most linux distributions ships PRepackaged versions of lxml. Otherwise refer to http://lxml.de/installation.html
(3)OpenSSL. This comes preinstalled in all Operating systems except Windows (see Platform specific installation notes)
(4)pip or easy_install Python package managers
我们安装的Ubuntu14.04系统都已经自带了前面3个,Python的版本为2.7.6。为了验证是否有安装,我们来查看一下。
打开终端,执行如下命令python, 接下来就是import lxml, import OpenSSL。如下图。
如果import没有报错,说明系统已经自带了。为保险起见,运行
sudo apt-get install python-dev
sudo apt-get install python-dev
再执行:
sudo apt-get install libevent-dev
安装pip
sudo apt-get install python-pip
安装Scrapy, 执行:
sudo apt-get install python-pip
安装Scrapy, 执行:
sudo pip install Scrapy