0

When I am trying to start scrapy, I get this error. Why would it come up?

$ scrapy startproject tutorial Traceback (most recent call last): File "/Applications/anaconda/bin/scrapy", line 5, in from pkg_resources import load_entry_point File "/Applications/anaconda/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg/pkg_resources.py", line 2697, in File "/Applications/anaconda/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg/pkg_resources.py", line 669, in require File "/Applications/anaconda/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg/pkg_resources.py", line 572, in resolve pkg_resources.DistributionNotFound: cryptography>=0.2.1 $

Feyzi Bagirov
  • 1,292
  • 4
  • 28
  • 46
  • 1
    Looks like you're missing the cryptography library. http://stackoverflow.com/questions/23316102/installing-scrapy-failing-on-cleaning – stevendaniels Jan 01 '15 at 02:48

1 Answers1

1

Scrapy has pyOpenSSL package as a dependency, which requires cryptography module to be installed. Either, reinstall scrapy from scratch:

pip uninstall Scrapy
pip install Scrapy

Or, install cryptography module separately:

pip install cryptography
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • I am getting an error: pip can't proceed with requirement 'cryptography>=0.2.1 (from pyOpenSSL->Scrapy)' due to a pre-existing build directory. location: /private/var/folders/7h/yd5112hd7xb1srw2ddbyrpj40000gn/T/pip_build_feyzi/cryptography This is likely due to a previous installation that failed. pip is being responsible and not assuming it can delete this. Please delete it and try again. How do I delete it cryptography? – Feyzi Bagirov Jan 01 '15 at 02:55
  • @FeyziBagirov `pip uninstall cryptography`? – alecxe Jan 01 '15 at 02:58
  • Why not restart again all the installation process in a virtualenv (https://pypi.python.org/pypi/virtualenv) to create isolated Python environments and re-check dependencies of the libraries ? – aberna Jan 01 '15 at 07:00
  • Getting an error again: Command "/Applications/anaconda/bin/python -c "import setuptools, tokenize;__file__='/var/folders/7h/yd5112hd7xb1srw2ddbyrpj40000gn/T/pip-build-_FXDpz/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/7h/yd5112hd7xb1srw2ddbyrpj40000gn/T/pip-g1Tgr2-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /var/folders/7h/yd5112hd7xb1srw2ddbyrpj40000gn/T/pip-build-_FXDpz/cffi – Feyzi Bagirov Jan 02 '15 at 04:29