報錯資訊:
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 setup.py install
然後安裝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 # 測試成功
參考:
https://blog.csdn.net/daiyutage/article/details/69945850
https://blog.csdn.net/EDDYCJY/article/details/77482228?locationNum=6&fps=1
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