35

I tried to update scrapy and when I tried to check the version I got the following error

C:\Windows\system32>scrapy version -v
:0: UserWarning: You do not have a working installation of the service_identity
module: 'No module named service_identity'.  Please install it from <https://pyp
i.python.org/pypi/service_identity> and make sure all of its dependencies are sa
tisfied.  Without the service_identity module and a recent enough pyOpenSSL to s
upport it, Twisted can perform only rudimentary TLS client hostname verification
.  Many valid certificate/hostname mappings may be rejected.
Scrapy  : 0.22.2
lxml    : 3.2.3.0
libxml2 : 2.9.0
Twisted : 14.0.0
Python  : 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)]
Platform: Windows-7-6.1.7601-SP1

what is that please and how to solve it ?

I am using windows 7

Marco Dinatsoli
  • 10,322
  • 37
  • 139
  • 253
  • 1
    @LieRyan for god sake, how could it be duplicated ? please try to think – Marco Dinatsoli Jun 06 '14 at 19:53
  • 3
    How to quickly gain reps in StackOverflow, ask this same question for every single packages that exists in Python. The error message describes very clearly what the problem is and how to rectify it, you should read and try to understand what error messages you received before asking questions in SO. This questions shows no attempt to do even that. – Lie Ryan Jun 06 '14 at 20:00
  • @LieRyan how could I know that service_identity is a python package ? I though that it is a service in Windows – Marco Dinatsoli Jun 06 '14 at 20:38
  • 1
    @Marco Dinatsoli: You shouldn't have stopped reading after the word "service". If you continue reading the error message you'll find a clear link to the [Python Package Index](https://pypi.python.org). – Matthias Jun 06 '14 at 21:07
  • @MarcoDinatsoli totally this is a dupe. – jb. Jun 06 '14 at 21:19
  • 4
    actual duplicate of http://stackoverflow.com/questions/23959336/scrapy-install-version-error – cregox Jul 19 '14 at 22:50
  • 2
    I had same problem on OSX 10.09, so it is not just on windows. – WebOrCode Feb 19 '15 at 10:26
  • 1
    so why isn't this a dependency? – dangel May 26 '18 at 01:37

1 Answers1

76
pip install service_identity

It is complaining that you do not have service_identity.

More information on the module can be found here on PyPI


Note that this is a rather unusual scenario, because service_identity is not a requirement of the twisted package, whose developers for some reason chose not to add it to its list of dependencies (cf. pyproject.toml), instead raising UserWarning about lack of this package, and requiring a manual intervention to fix.

mirekphd
  • 4,799
  • 3
  • 38
  • 59
Padraic Cunningham
  • 176,452
  • 29
  • 245
  • 321
  • 9
    It still get about the same *warning* (not an error, @Marco) message despite having it installed. Only the first phrase differs a little, probably because I'm running on mac. It says: `UserWarning: You do not have the service_identity module installed.` But when I run `pip install service_identity` (again) I get `Requirement already satisfied`. :( – cregox Jul 18 '14 at 09:38
  • 4
    @Cawas I was getting the same warning. It's funny but looks like service_identity didn't install it's dependencies. I had to `pip install pyasn1 characteristic` to get it to work on the Mac. That fixed the warning. – Kasisnu Oct 02 '14 at 17:32
  • 4
    @Cawas try `sudo easy_install service_identity` – Yuwen Yan Aug 16 '15 at 06:29
  • I had to use `pip install service_identity --force` to solve the issue – rubo77 Jun 11 '19 at 21:31
  • This one didn't work for me but because using anaconda `conda install service_identity` fixed this error – sweetnlow Dec 06 '19 at 03:02
  • For me `service_identity==21.1.0` needs `attrs==22.2.0`, I had `attrs==21.2.0` & it was failing with error `ModuleNoFoundError attrs` – OO7 Feb 01 '23 at 07:23
  • Make sure you install service_identity with service_identity==21.1.0 (or whatever the most recent version here https://service-identity.readthedocs.io/en/stable/installation.html is). I got this error because I had version 18 instead of 21. – Alex Li Jun 01 '23 at 00:14