easy_install - pyCurl 安装问题

easy_install - pyCurl install issue

我正在尝试使用 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

已使用 brew 安装了 openssl,它的版本是 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