一些python依赖包安装问题汇总

1、pycurl 运行时抛出异常

设置环境变量 PYCURL_SSL_LIBRARY

# ImportError: pycurl: libcurl link-time ssl backend (nss) 
#  is different from compile-time ssl backend (openssl) 

pip uninstall pycurl
export PYCURL_SSL_LIBRARY=nss
easy_install pycurl

2、mac下安装M2Crypto出错

安装前先设定openssl环境变量

export LDFLAGS="-L$(brew --prefix openssl)/lib"
export CFLAGS="-I$(brew --prefix openssl)/include"
export SWIG_FEATURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include" 

 

3、centos pycurl 安装问题

.ConfigurationError: Curl is configured to use SSL, but we have not been able to determine which SSL backend it is using. Please see PycURL documentation for how to specify the SSL backend manually.

export PYCURL_SSL_LIBRARY=openssl

Could not run curl-config: [Errno 2] No such file or directory: 'curl-config'

yum install libcurl-devel

 

src/pycurl.h:164:28: fatal error: openssl/ssl.h: No such file or directory

yum install -y openssl-devel

fatal error: Python.h: No such file or directory

yum install python-devel

 

NAME="nss"
pip uninstall pycurl
export PYCURL_SSL_LIBRARY=${NAME}
pip install --compile --global-option="--with-${NAME}" pycurl

 

 

转载于:https://my.oschina.net/pp1/blog/882665

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值