我正在尝试使用 easy_install 安装 pyCurl,但出现以下错误
In file included from src/docstrings.c:4:
src/pycurl.h:170:13: fatal error: 'openssl/crypto.h' file not found
include <openssl/crypto.h>
1 error generated.
error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1
该openssl
已使用 brew
安装,并且它的版本是LibreSSL 2.2.7.
我已经使用 xcode-select --install
安装了 xcode 工具,并且似乎没有解决问题。使用pip
安装时我也遇到了同样的问题。
这可能会解决您的问题。
$export PYCURL_SSL_LIBRARY=openssl
$export LDFLAGS="-L/usr/local/opt/openssl/lib"
$export CPPFLAGS="-I/usr/local/opt/openssl/include"
现在你可以easy_install或者如果你使用的是pip,下面的命令应该是。
$ pip install --no-cache-dir --compile --ignore-installed --install-option="--with-openssl" pycurl