Stories

Detail Return Return

macOS是Python2安裝cryptography - Stories Detail

pip install cryptography==2.9.2

報錯

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

嘗試導出

export CPPFLAGS=-I/opt/homebrew/Cellar/openssl@3/3.4.0/include
export LDFLAGS=-L/opt/homebrew/Cellar/openssl@3/3.4.0/lib

換了個錯

error: call to undeclared function 'ERR_GET_FUNC'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

應該是版本兼容的問題,下載低版本的openssl安裝

wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz
tar -zxf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w
./config
make
sudo make install
# 重新安裝就行了
pip install cryptography==2.9.2

Add a new Comments

Some HTML is okay.