Ubuntu pkg_resources.DistributionNotFound: The 'Scrapy==1.0.3' distribution was not found and is required by the application
在Ubuntu16.0.4上安装scrapy,参考:Ubuntu16.04安装Scrapy命令
都安装成功后,import scrapy也都没出错,但是在终端输入:scrapy 命令时出现错误:
File "/usr/local/python2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 870, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'Scrapy==1.0.3' distribution was not found and is required by the application
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'Scrapy==1.0.3' distribution was not found and is required by the application
【翻译: pkg_resources.DistributionNotFound:'Scrapy == 1.0.3'发行版没有被发现,并且是应用程序所要求的】
找原因:pip install scrapy默认给安装的scrapy版本是Scrapy 1.0.3-1 而给出的提示是应用程序需要Scrapy 1.0.3
解决方法:在终端输入:sudo pip install Scrapy==1.0.3
这样问题就解决了,在终端输入:scrapy 出现如下