centos安装scrapy
wget -c http://www.python.org/ftp/python/2.6.5/Python-2.6.5.tar.bz2
tar jxvf Python-2.6.5.tar.bz2
cd Python-2.6.5
./configure -prefix=/usr/local/python2.6
make && make install
#更改系统默认版本
mv /usr/bin/python /usr/bin/python.bak
ln -s /usr/local/python2.6/bin/python /usr/bin/python
#修复不能正常工作的yum
# 将第一行末的 python 后加上 2.6,即将第一行改为:
# !/usr/bin/python2.6
这样,yum 依然使用 python 2.6 环境运行,一切恢复正常。
安装Twisted
wget http://tmrc.mit.edu/mirror/twisted/Twisted/8.1/Twisted-8.1.0.tar.bz2
tar jxvf Twisted-8.1.0.tar.bz2
cd Twisted-8.1.0
python setup.py install
安装zope.interface
wget http://pypi.python.org/packages/source/z/zope.interface/zope.interface-3.6.3.tar.gz
tar zxvf zope.interface-3.6.3.tar.gz
cd zope.interface-3.6.3
python setup.py install
安装libxml2
yum install libxml2 -y
安装 pyopenssl
yum install pyOpenSSL
安装scrapy
wget http://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.14.2.tar.gz#md5=aefc425cf5eea31eae029146cf8a8755
tar zxvf Scrapy-0.14.2.tar.gz
cd Scrapy-0.14.2
python setup.py install
当上述方法不管用时
centos安装scrapy
yum install python-setuptools
yum install python-devel
yum install python-dev
easy_install Scrapy
#测试是否安装成功
scrapy -version