igarelik
igarelik

Reputation: 1

Problem installing cryptography on MacOS Monterey with ARM chip

I am trying to install the cryptography package on my MacBook with ARM chip running Monterey MacOS. The command I issue is

pip3 install cryptography --global-option=build_ext 
  --global-option="-L/opt/homebrew/Cellar/[email protected]/1.1.1m/lib/"
  --global-option="-I/opt/homebrew/Cellar/[email protected]/1.1.1m/include"

I am getting the error:

build/temp.macosx-10.14-arm64-3.8/_openssl.c:575:10: 
   fatal error: '***openssl/opensslv.h***' file not found

#include <openssl/opensslv.h>. I definitely have that file under /opt/homebrew/Cellar/[email protected]/1.1.1m/include/, and that directory is in my path. Please, advise what I am doing wrong.

Upvotes: 0

Views: 2444

Answers (1)

rennf93
rennf93

Reputation: 61

I was having the same issue.

Try installing openssl with brew

brew install openssl

, then what really does the trick is in cryptography's documentation: https://cryptography.io/en/latest/installation/

brew install [email protected] rust

env LDFLAGS="-L$(brew --prefix [email protected])/lib" CFLAGS="-I$(brew --prefix [email protected])/include" pip3 install cryptography

Don't forget to adjust pip/pip3 and cryptography's versions as needed at the end of the command.

Hope it works for you as well! :)

Upvotes: 1

Related Questions