的OpenSSL / aes.h'在Mac上找不到文件

时间:2017-08-15 12:47:22

标签: python macos encryption openssl

我试图安装代理重新加密方案的python实现,我发现here

运行$ sudo python setup.py install时,我收到错误

fatal error: 'openssl/aes.h' file not found

围绕这些问题(thisthis(不适用于mac))但没有一个问题解决了我的问题。

我已经尝试过(全都取自我发现的答案):

  1. 正在运行env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography并重试;
  2. brew install openssl然后再试一次;
  3. brew reinstall python然后再试一次;
  4. 选项1.返回

    Requirement already satisfied: cryptography in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
    Requirement already satisfied: six>=1.4.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from cryptography)
    Requirement already satisfied: setuptools>=11.3 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from cryptography)
    Requirement already satisfied: cffi>=1.4.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from cryptography)
    Requirement already satisfied: pyasn1>=0.1.8 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from cryptography)
    Requirement already satisfied: enum34 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from cryptography)
    Requirement already satisfied: ipaddress in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from cryptography)
    Requirement already satisfied: idna>=2.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from cryptography)
    Requirement already satisfied: pycparser in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from cffi>=1.4.1->cryptography)
    

    我正在运行OSX 10.12.6。

    有什么想法吗?

2 个答案:

答案 0 :(得分:13)

首先检查$(brew --prefix openssl)/include指出的路径是否存在。

如果上面没问题,你可以试试

$ cd /usr/local/include
$ ln -s ../opt/openssl/include/openssl .

请注意:Nginx Cannot Find OpenSSL Development Headers

答案 1 :(得分:0)

使用cryptography==1.0.1解决了此问题。升级到2.9.2