当我运行命令 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/