python - 如何在 Mac OS X 中为 python3 安装密码学?

标签 python macos pip

执行pip3 install cryptography时, pip3报错:

fatal error: 'openssl/aes.h' file not found
#include <openssl/aes.h>

1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

我检查了 brew info openssl得到了答案:

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

现在的问题是:我怎么知道pip使用 clang 时将路径添加到相应的构建变量中编译cpp文件?

最佳答案

尝试安装 scrapy 我需要在 Mac OS El Capitan 上安装加密包。如密码学安装文档中所述

env LDFLAGS="-L$(brew --prefix openssl)/lib"CFLAGS="-I$(brew --prefix openssl)/include"pip install cryptography

关于python - 如何在 Mac OS X 中为 python3 安装密码学?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33688875/

相关文章:

objective-c - 查找 Mac OSX 序列号

python - 如何为 Python 安装 yaml 包?

python - pip uninstall broken with -py2.7 in egg path

使用列表结构但不使用列表方法的Python堆栈模拟

python virtualenv ImportError 没有名为 inspect time flask 的模块

python - 在 Python 中将十六进制字符串拆分为 block

linux - OSX 外壳中的 "read: -i: invalid option"

macos - 如何ping文件中的每个IP?

git - 无法在 Github 上为 pip install git+ssh 指定 key 文件

python - 为什么 Spark 输出一组 csv 而不是输出一个?