我们主要在linux系统上做开发,因此讲一下ubuntu系统中scrapy框架的搭建

1、准备好搭建环境所需的gcc

运行一下代码:

sudo apt-get install python-dev
sudo apt-get install libevent-dev
 sudo apt-get install libxml2 libxml2-dev

apt-get install libxml2-dev libxslt-dev

apt-get install python-lxml

2、安装Twisted

sudo apt-get install python-twisted python-libxml2 python-simplejson

3、安装pyOpenSSL

 wget http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.tar.gz
tar -zxvf pyOpenSSL-0.13.tar.gz
cd pyOpenSSL-0.13
sudo python setup.py install

4、安装pycrypto

 wget http://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.5.tar.gz
tar -zxvf pycrypto-2.5.tar.gz
cd pycrypto-2.5
sudo python setup.py install

5、安装w3lib

 sudo easy_install -U w3lib

6、安装easy_install(如果安装了就不用再安装了)

 wget http://peak.telecommunity.com/dist/ez_setup.py
 python ez_setup.py

7、安装Scrapy

 sudo easy_install Scrapy

好了,此时在linux上的Scrapy框架正式搭建完毕了。





Logo

更多推荐