Install Scrapy on OS X El Capitan

I tried installing Scrapy on El Capitan, but was not successful so far. This happens when I use pip install Scrapy:

#include <openssl/opensslv.h>

         ^

1 error generated.

error: command 'cc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /<scrapy_project>/venv/bin/python -c "import setuptools, tokenize;__file__='/<scrapy_project>/venv/build/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/p6/jvf54l7d5c7dntzm6d3rfc3w0000gn/T/pip-D2QIZq-record/install-record.txt --single-version-externally-managed --compile --install-headers /<scrapy_project>/venv/include/site/python2.7 failed with error code 1 in /<scrapy_project>/venv/build/cryptography

My Xcode and Xcode command line tools are updated. I tried installing Scrapy with and without an approach via homebrew as per http://doc.scrapy.org/en/latest/intro/install.html#intro-install

Edit: I did the following:

  • brew install openssl && brew link openssl --force According to Craicerjack Offer
  • pip install cryptography
  • pip install Scrapy

everything worked without errors. But it scrapy --versioncauses this error:

ImportError: dlopen(/<scrapy_project>/venv/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so, 2): Symbol not found: _BIO_new_CMS
  Referenced from: /<scrapy_project>/venv/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so
  Expected in: flat namespace
 in /<scrapy_project>/venv/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so
+4
source share
1 answer

The problem is installing the dependencies required for Scrapy

First of all, you need to upgrade to the latest pip version:

pip install --upgrade pip

, :

brew install openssl
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography  

LDFLAGS="-L/usr/local/opt/openssl/lib" pip install cryptography --no-use-wheel

, , , ( ) . github

+5

All Articles