1

When executing pip3 install cryptography, pip3 gives an error:

fatal error: 'openssl/aes.h' file not found
#include <openssl/aes.h>

1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

I checked with brew info openssl and got the answer:

Generally there are no consequences of this for you. If you build your own software and it requires this formula, you'll need to add to your build variables:

LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include

The problem now is: how can I tell pip add the paths into corresponding build variables when it uses clang to compile cpp file?

cel
  • 27,769
  • 16
  • 88
  • 113
htredleaf
  • 193
  • 2
  • 9

1 Answers1

10

Trying to install the scrapy I need to install cryptography package on Mac OS El Capitan. As explained in Cryptography installation doc

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

Fabien Sa
  • 8,378
  • 2
  • 36
  • 42
Claude COULOMBE
  • 3,026
  • 1
  • 30
  • 35