pip install openssl / aes.h错误和libxml / xmlversion.h错误(osx)

时间:2016-01-26 18:48:46

标签: python django

我有一个'requirements.txt'文件,我点了安装它。并继续得到这些错误:

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 个答案:

答案 0 :(得分:2)

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

brew link --force openssl

xcode-select --install

答案 1 :(得分: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

pip install