報錯資訊:
pkg_resources.DistributionNotFound:
The 'pip==1.5.4' distribution was not found and is required by the application
根據提示資訊可以知道distribution沒有安裝,是以就安裝一下:
$wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz
$tar -xzvf distribute-0.6.10.tar.gz
$cd distribute-0.6.10
$python
然後安裝pip 1.5.4
easy_install pip==1.5.4
現在運作scrapy報錯:
bash: scrapy: command not found
這就是Path裡沒有找到scrapy,現在scrapy在/usr/local/bin/scrapy裡,是以在Path裡做一個軟連接配接到這兒就可以。
$cd /usr/bin/ | ll | grep scrapy # 檢查是否存在
$ln -s /usr/local/bin/scrapy /usr/bin/scrapy # 建立一個軟連接配接
$scrapy list # 測試成功
windows下個人總結的安裝scrapy填坑:
① 安裝python2.7(2.7.9以後應該都自帶pip和setuptool了)
② 安裝pywin32(linux應該可以跳過,win下沒有這個運作scrapy會報錯)
③ 安裝lxml 去https://pypi.python.org/pypi/lxml下載下傳對應版本(win目前隻有3.6.0)
④ 安裝pyOpenSSL,去https://launchpad.net/pyopenssl下載下傳對應版本安裝
⑤ pip install Scrapy