2016-01-26 50 views
3

我有'requirements.txt'文件,我点安装它。并不断地得到这些错误:pip安装openssl/aes.h错误和libxml/xmlversion.h错误(osx)

Cryptography_cffi_a269d620xd5c405b7.c:217:10: fatal error: 'openssl/aes.h' file not found 
#include <openssl/aes.h> 
     ^
1 error generated. 
error: command 'clang' failed with exit status 1 

而这个错误:

fatal error: 'libxml/xmlversion.h' file not found 
#include "libxml/xmlversion.h" 
     ^
1 error generated. 
error: command 'clang' failed with exit status 1 

试图https://github.com/pyca/cryptography/issues/2350

回答

2

我做了两件事情来解决这个问题了。

brew link --force openssl 

xcode-select --install 
2

现在,不幸的是,我们不能brew link --force openssl。所以你也可以设置如下的环境变量:

export LD_LIBRARY_PATH=/usr/local/opt/openssl/lib:$LD_LIBRARY_PATH 
export CPATH=/usr/local/opt/openssl/include:$LD_LIBRARY_PATH 

And do pip install