-1

I have such problem, I did nothing with Python or Scrapy, but when I started today my computer I got such error. I have found many different posts and tried some tips and advices, unfortunately, they are do not work properly and I worry not to break something else.

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

Therefore, maybe someone had the same error. If yes, please, let me know how you solved it.

UPDATE: I have tried many things and direct search was without real results, only Python & Scrapy: Issue with Scrapy version was helpful, I have deleted Scrapy and installed it again. Magic, but it works.

Community
  • 1
  • 1
Dmytro Chasovskyi
  • 3,209
  • 4
  • 40
  • 82

1 Answers1

1

I had a similar issue back then and It was because the Ubuntu package was messing with the pip package.

I recommend you to remove both packages from Ubuntu and Pip and then reinstall.

First remove scrapy with all local config file from ubuntu by following command :

apt-get remove --purge python-scrapy

pip uninstall scrapy

After these actions finished you can reinstall it using following commands.Now version should be 0.24.4.

  1. Import the GPG key used to sign Scrapy packages into APT keyring:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 627220E7

  1. Create /etc/apt/sources.list.d/scrapy.list file using the following command:

echo 'deb http://archive.scrapy.org/ubuntu scrapy main' | sudo tee /etc/apt/sources.list.d/scrapy.list

3.Update package lists and install the scrapy-0.24 package:

sudo apt-get update && sudo apt-get install scrapy-0.24

It should work :)

Siyaram Malav
  • 4,414
  • 2
  • 31
  • 31