如何在Mac OS X中为python3安装加密? [英] How to install cryptography for python3 in Mac OS X?
问题描述
执行pip3 install cryptography
时,pip3
给出错误:
严重错误:找不到'openssl/aes.h'文件
#include <openssl/aes.h>
fatal error: 'openssl/aes.h' file not found
#include <openssl/aes.h>
1个错误.
错误:命令'/usr/bin/clang'失败,退出状态为
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
我与brew info openssl
进行了核对,并得到了答案:
I checked with brew info openssl
and got the answer:
通常,这对您没有任何影响.如果你建立你的 自己的软件,它需要此公式,您需要将其添加到 构建变量:
Generally there are no consequences of this for you. If you build your own software and it requires this formula, you'll need to add to your build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
现在的问题是:当我使用clang
编译cpp文件时,如何告诉pip
将路径添加到相应的构建变量中?
The problem now is: how can I tell pip
add the paths into corresponding build variables when it uses clang
to compile cpp file?
推荐答案
尝试安装scrapy我需要在Mac OS El Capitan上安装加密软件包.如密码学安装文档中所述
Trying to install the scrapy I need to install cryptography package on Mac OS El Capitan. As explained in Cryptography installation doc
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography
这篇关于如何在Mac OS X中为python3安装加密?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!