解决Mac OS X 10.11 El Capitan 上 openssl/aes.h file not found 的问题

clayluo 2016-07-05

现象:

安装pyOpenSSL时报错:

build/temp.macosx-10.10-x86_64-2.7/_openssl.c:400:10:fatalerror:'openssl/aes.h'filenotfound

尝试解决方案:

首先brewinstallopenssl发现已经安装

然后再使用xcode-select-p命令查找xcode安装所在目录

比如命令得到安装目录为:/Applications/Xcode.app/Contents/Developer

再然后进入/Applications/Xcode.app/Contents/Developer,查找ssl.h

cd/Applications/Xcode.app/Contents/Developer&&find.-namessl.h

得到ssl.h所在目录,比如:./Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/openssl/ssl.h

然后将整个openssl所在目录拷贝至/usr/local/include/中:

cp-R/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/openssl/usr/local/include/

再次安装,问题解决

相关推荐