python - fatal error : 'openssl/e_os2.h' file not found in pypy

标签 python python-2.7 cryptography pypy pyopenssl

当我运行命令 pypy -m pip install cryptography

然后我遇到以下错误:

cc -arch x86_64 -O2 -fPIC -Wimplicit -I/opt/pypy-5.0.1/include -c build/temp.macosx-10.10-x86_64-2.7/_openssl.c -o build/temp.macosx- 10.10-x86_64-2.7/build/temp.macosx-10.10-x86_64-2.7/_openssl.o build/temp.macosx-10.10-x86_64-2.7/_openssl.c:423:10: fatal error :找不到“openssl/e_os2.h”文件 #包括 ^ 生成 1 个错误。 错误:命令“cc”失败,退出状态为 1

----------------------------------------

命令“/usr/local/bin/pypy -u -c”导入setuptools,标记;文件='/private/var/folders/_t/8l_tq9210xl4bzlhkspnv8br0000gn/T/pip-build- gjhf5l/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(文件).read().replace('\r\n', '\n '), 文件, 'exec'))"install --record/var/folders/_t/8l_tq9210xl4bzlhkspnv8br0000gn/T/pip-6_y8I9-record/install-record.txt --single-version-外部管理的 --compile"在/private/var/folders/_t/8l_tq9210xl4bzlhkspnv8br0000gn/T/pip-build-Gjhf5l/cryptography/中失败,错误代码为 1

最佳答案

在 OS X PyPy 上,您需要 brew install openssl (或 port install 等),然后运行以下命令:

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

如果您使用端口,请修改路径以指向正确的位置。

关于python - fatal error : 'openssl/e_os2.h' file not found in pypy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36662704/

相关文章:

android - 使用Android的PyGame子集进行音频

python - 如何在 tkinter 中使用文件对话框获取文件名?

python - 如何在通用 Updateview 中使用 UserPassesTestMixin

python - PyTorch - 尽管检测到 CUDA 支持,但张量并未使用 GPU

python - 使用 Python 子进程处理交互式 shell

java - 生成SER证书文件

python - 有时只读属性

python - r"string"b"string"u"string"Python 2/3 比较

python-3.x - 为什么电子邮件确认码不能是 UUID?

security - 检查机器数量