1

Scrapy will not run on my Ubuntu 14.04 giving the error:

Traceback (most recent call last):
File "/usr/bin/scrapy", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 444, in _build_master
ws.require(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 725, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 628, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: service-identity

Timeline: I had Python 2.7.6 installed which came with Ubuntu 14.04. I upgraded to 2.7.9 which is currently my python -V. I started by downloaded scrapy from the website (scrapy.org) following their Ubuntu instructions, and I got the error code above when attempting to use scrapy. Then I went through every imaginable stackoverflow for pip being broken, scrapy being broken but no good.

pip upgrade did not work: pip broke. how to fix DistributionNotFound error?

This guy had almost the same error but no response: Python(Scrapy) unpredictable mistake with "import load_entry_point" He pointed to: Python & Scrapy: Issue with Scrapy version

I uninstalled all scrapy and reinstalled with pip (it was installing version Scrapy-1.0.3) and it initially failed but I upgraded some libraries (libffi & lxml) and the install worked with a sudo run. Same error remained when running scrappy.

Any chance anyone knows whats going on? Thanks

Community
  • 1
  • 1
wprins
  • 846
  • 2
  • 19
  • 35

1 Answers1

7

make sure you have installed the service identity package. you can install it by:

sudo pip install service-identity
Omair Shamshir
  • 2,126
  • 13
  • 23
  • I ran this and it said that all requirements were already satisfied. But after I tried running scrapy again it actually worked! I'm not sure if this command did anything but its working now. I don't know what happened between now and last night but maybe this or a reboot did it! I'm going to go ahead and give you the check! – wprins Sep 10 '15 at 17:29