easy_install - pyCurl安装问题

myk*_*ilo 4 python pip pycurl easy-install

我正在尝试使用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工具安装xcode-select --install似乎并没有已经解决了这一问题.安装使用时我也遇到了同样的问题pip.

小智 14

这可能会解决您的问题.

  $export PYCURL_SSL_LIBRARY=openssl
  $export LDFLAGS="-L/usr/local/opt/openssl/lib"
  $export CPPFLAGS="-I/usr/local/opt/openssl/include"
Run Code Online (Sandbox Code Playgroud)

现在你可以easy_install或者如果你使用下面的pip应该是命令.

$ pip install --no-cache-dir --compile --ignore-installed --install-option="--with-openssl" pycurl
Run Code Online (Sandbox Code Playgroud)