Building on macOS

<aside> 💡 This is pretty outdated, as it applies only to Python 2.6.

It's kept around for posterity.

</aside>

If building from source on macOS, you might encounter this error:

build/temp.macosx-10.11-intel-2.6/_openssl.c:483:10: fatal error: 'openssl/opensslv.h' file not found
    #include <openssl/opensslv.h>
             ^
    1 error generated.
    error: command 'clang' failed with exit status 1

This is pretty likely if you're having to install on Python 2.6 or earlier (as part of building/testing older releases), since there are no wheels for this version.

To solve this, you'll need homebrew, and will need to install a newer OpenSSL and point pip to it. Run:

$ brew install [email protected]
$ LDFLAGS="-L$(brew --prefix [email protected])/lib" \\
  CFLAGS="-I$(brew --prefix [email protected])/include" \\
  pip2.6 install cryptography