歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Ubuntu Linux >> Ubuntu&Windows下scrapy安裝攻略

Ubuntu&Windows下scrapy安裝攻略

日期:2017/3/6 9:27:46   编辑:Ubuntu Linux

Ubuntu&Windows下scrapy安裝攻略


Ubuntu&Windows下scrapy安裝攻略


scrapy是python下的一個開源包,首先你要安裝這個。首先當然是要安裝python環境。。Ubuntu默認自帶一個python環境,Windows下需要自行安裝並配置環境變量等,在此不多做贅述。

1.Windows

Windows下scrapy需要很多的依賴包。

(1)pywin32

pywin32下載地址:https://sourceforge.net/projects/pywin32/files/pywin32/

(2)twisted

當然twisted這個異步通信框架也需要一些依賴包(= =)。

zope.interface 和 pyopenssl

zope下載地址:https://pypi.python.org/pypi/zope.interface#download

pyopenssl下載地址:https://pypi.python.org/pypi/pyOpenSSL

twisted下載地址:http://twistedmatrix.com/trac/wiki/Downloads

(3)lxml

下載地址:https://pypi.python.org/pypi/lxml/

ps:如果遇到.whl的擴展名,只需改成.rar解壓後將裡面的文件夾放到python的系統環境中即可。

(4)安裝scrapy

安裝scrapy有很多方法。可以用easytool

我是用pip裝的:pip install scrapy

2.Ubuntu

(1).升級python至2.7.11(自帶pip) ---可選,也可不升級

wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz

tar -xvf Python-2.7.11.tgz

cd Python-2.7.11

./configure && make && make install && make clean #

(2)安裝依賴包

apt-get install python-dev libxml2-dev libxslt1-dev libssl-dev libffi-dev #

(3)安裝scrapy

pip install Scrapy

http://xxxxxx/Linuxjc/1145132.html TechArticle

Copyright © Linux教程網 All Rights Reserved