MacOS安装pycurl
mac python3安装pycurl导入失败问题:ImportError: pycurl: libcurl link-time ssl backends (secure-transport, openssl) do not include compile-time ssl backend (none/other)
- pip uninstall pycurl # 先卸载
- export PYCURL_SSL_LIBRARY=openssl
- export LDFLAGS=-L/usr/local/opt/openssl/lib
- export CPPFLAGS=-I/usr/local/opt/openssl/include # openssl相关文件路径
- pip install pycurl --compile --no-cache-dir # 重新编译安装
- 安装时如果报错:src/pycurl.h:178:13: fatal error: 'openssl/ssl.h' file not found
6-1. 可能是因为没有安装openssl
brew install openssl(没有brew先安装brew)
6-2. 已经安装了openssl
查看出问题的代码,比如:某个*.c文件提示 #include <openssl/ssl.h>找不到文件ssl.h。那么直接在找到openssl的安装路径(brew --prefix openssl),在路径下找到代码ssl.h,然后拷贝一份放到*.c文件的同目录的openssl目录下