python3安装pycurl

centos7安装pycurl

出现错误

FileNotFoundError: [Errno 2] No such file or directory: 'curl-config'
ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)
https://github.com/pycurl/pycurl/pull/353

安装包解决办法:
重新安装以下的库
centos

yum install libcurl-devel

由于libcurl的源码编译因素,在安装pycurl可能会导致以下两种错误。

错误1:

ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)

错误2:

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

解决办法:

错误1的解决办法如下:

pip uninstall pycurl

export PYCURL_SSL_LIBRARY=openssl

pip install pycurl

错误2的解决办法如下:

pip uninstall pycurl

export PYCURL_SSL_LIBRARY=nss

pip install pycurl

结果

Installing collected packages: pycurl Running setup.py install for pycurl ... done Successfully installed pycurl-7.43.0.1 

源码解决办法

wget http://curl.haxx.se/download/curl-7.24.0.tar.gz
tar -zxvf curl-7.24.0.tar.gz
cd curl-7.24.0
./configure
make && make install

安装pycurl,使用--curl-config=制定curl-config的路径

wget https://dl.bintray.com/pycurl/pycurl/pycurl-7.43.0.1.tar.gz tar -xzvf pycurl-7.43.0.1.tar.gz cd pycurl-7.43.0.1 python3 setup.py --with-openssl install --curl-config=/usr/local/bin/curl-config 

结果

Using /usr/local/bin/curl-config (libcurl 7.24.0)
running install
running build
running build_py
creating build
......
Writing /usr/local/python3/lib/python3.6/site-packages/pycurl-7.43.0.1-py3.6.egg-info

安装成功

转载于:https://www.cnblogs.com/52py/p/9481229.html

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值