2017-08-15 124 views
1

我試圖安裝一個代理重新加密方案的python實現,我發現here在Mac上找不到openssl/aes.h'文件

當運行$ 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並再次嘗試;

選項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。

任何想法?

+1

'sudo'下降了很多普通用戶的環境。像'env LDFLAGS = ...'之類的東西就會消失,除非你使用諸如'-e'和'-E'(IIRC)之類的選項。在非特權帳戶下構建事物,並使用root進行安裝。 – jww

回答