4

I have installed scrapy on my mac (OS El Capital, 10.11.4), there does not seem to be any compatibilty problem between scrapy and my python version (2.7.11) but when I try to start a project with scrapy startproject tutorial I get following error message:

pkg_resources.DistributionNotFound: The 'pyasn1' distribution was not 
found and is required by service-identity

I have tried updating both the pyasn1 and the service identity package, but that did not change anything. I have not found any help regarding this specific problem.

Has anyone ever experienced a similar problem? Is there a solution (even a "brutal" one, like uninstalling everything to start from scratch)?

vincisson
  • 43
  • 1
  • 5
  • I am not sure how exactly you installed scrapy and why the dependencies were not pulled in automatically, but would just "pip install pyasn1" or "easy_install pyasn1" help? I suspect other dependencies may not be satisfied as well. – Ilya Etingof May 01 '16 at 16:30
  • When I type `pip install pyasn1` I get `Requirement already satisfied (use --upgrade to upgrade): pyasn1 in /usr/local/lib/python2.7/site-packages` then when I upgrade it I get `Requirement already up-to-date: pyasn1 in /usr/local/lib/python2.7/site-packages`. Somehow the problem seems to be deeper? – vincisson May 01 '16 at 17:26

2 Answers2

3

There is no need to install everything from scratch. I suggest you to build scrapy in a separate python environment. In my case, a simple pip install cryptography in my environment solved this issue.

hAcKnRoCk
  • 1,118
  • 3
  • 16
  • 30
  • This worked for me when I upgraded my server from Ubuntu 14.04 LTS to Ubuntu 16.04 LTS – tytk Jun 13 '17 at 18:33
1

I found that the problem was due to El Capitan getting rid of openssl headers. This was causing cryptography build to fail.

I found the answer by following: Install Scrapy on OS X El Capitan

The important parts are:

brew install openssl
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography  
pip install --upgrade scrapy
Community
  • 1
  • 1
ajaali
  • 860
  • 12
  • 16