最近根據須要,使用scrapy開發了一個爬蟲應用,直接使用的python2,記錄一下部署環境。python
1.安裝epel擴展源 scrapy
yum -y install epel-release阿里雲
2.安裝pipcrontab
yum -y install python-pipip
3.安裝scrapy ssl
pip install scrapy開發
阿里雲鏡像:pip install scrapy -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com部署
4.若出現 command 'gcc' failed with exit status 1,gcc編譯缺乏模塊openssl
yum install gcc libffi-devel python-devel openssl-develit
5.未安裝MySQLdb
yum install MySQL-python
6.若需定時腳本
crontab -e
案例:0 * * * * cd /wnet/pig && scrapy crawl price