阅读更多
现象:
安装pyOpenSSL时报错:
build/temp.macosx-10.10-x86_64-2.7/_openssl.c:400:10: fatal error: 'openssl/aes.h' file not found
尝试解决方案:
首先brew install openssl 发现已经安装
然后再使用xcode-select -p命令查找xcode安装所在目录
比如命令得到安装目录为:/Applications/Xcode.app/Contents/Developer
再然后进入/Applications/Xcode.app/Contents/Developer,查找ssl.h
cd /Applications/Xcode.app/Contents/Developer && find . -name ssl.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/
再次安装,问题解决