Python安装pycurl失败的解决方法


Posted in Python onOctober 15, 2018

Centos安装pycurl

centos 安装pycurl
yum install python-devel curl-devel
pip3 install pycurl

Mac(老版本)安装pycurl

解决MacOS升级后出现xcrun: error: invalid active developer path, missing xcrun的问题

xcode-select --install
然后
dongchang-5:qqmusic baoshan$ pip3 install pycurl
Collecting pycurl
 Using cached pycurl-7.43.0.1.tar.gz
Building wheels for collected packages: pycurl
 Running setup.py bdist_wheel for pycurl ... done
 Stored in directory: /Users/baoshan/Library/Caches/pip/wheels/a5/5b/c8/f80900b09b49815e1f90dbae2f57e49b3f4c61071db40fb238
Successfully built pycurl
Installing collected packages: pycurl
Successfully installed pycurl-7.43.0.1

ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)
解决办法
# pip uninstall pycurl
# export PYCURL_SSL_LIBRARY=openssl
# pip install pycurl

dongchang-5:qqmusic baoshan$ pip3 install pycurl
Collecting pycurl
Installing collected packages: pycurl
Successfully installed pycurl-7.43.0.1

上述参考自:http://www.kxtry.com/archives/398

dongchang-5:include baoshan$ python3
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycurl
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)

参考解决方案:https://www.jianshu.com/p/50b6771eb853

新版本Mac安装pycurl

但是这里有一个坑:在高版本的mac系统环境变量里是找不到openssl的头文件的
因为新版本Mac的openssl版本 LibreSSL 2.2.7

pip3 uninstall pycurl# 卸载库
export PYCURL_SSL_LIBRARY=openssl
export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include# openssl相关头文件路径
pip3 install pycurl --compile --no-cache-dir # 重新编译安装

至此终于搞定。


dongchang-5:pycurl-7.43.0 baoshan$ python3
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycurl
>>>


参考:https://segmentfault.com/q/1010000012674778

搞了一个多下午,终于找到解决方法。。。

以上这篇Python安装pycurl失败的解决方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持三水点靠木。

Python 相关文章推荐
深入分析在Python模块顶层运行的代码引起的一个Bug
Jul 04 Python
tensorflow TFRecords文件的生成和读取的方法
Feb 06 Python
Python import与from import使用及区别介绍
Sep 06 Python
值得收藏,Python 开发中的高级技巧
Nov 23 Python
详解python中的hashlib模块的使用
Apr 22 Python
Django项目之Elasticsearch搜索引擎的实例
Aug 21 Python
利用 Flask 动态展示 Pyecharts 图表数据方法小结
Sep 04 Python
Python操作Mongodb数据库的方法小结
Sep 10 Python
基于Python共轭梯度法与最速下降法之间的对比
Apr 02 Python
python 在右键菜单中加入复制目标文件的有效存放路径(单斜杠或者双反斜杠)
Apr 08 Python
Django项目如何获得SSL证书与配置HTTPS
Apr 30 Python
Python中第三方库Faker的使用详解
Apr 02 Python
django框架之cookie/session的使用示例(小结)
Oct 15 #Python
Python访问MongoDB,并且转换成Dataframe的方法
Oct 15 #Python
Django框架的中的setting.py文件说明详解
Oct 15 #Python
python得到电脑的开机时间方法
Oct 15 #Python
python得到单词模式的示例
Oct 15 #Python
详解python如何在django中为用户模型添加自定义权限
Oct 15 #Python
Python 实现某个功能每隔一段时间被执行一次的功能方法
Oct 14 #Python
You might like
基于mysql的bbs设计(三)
2006/10/09 PHP
PHP中if和or运行效率对比
2014/12/12 PHP
PHP构造二叉树算法示例
2017/06/21 PHP
Laravel 微信小程序后端实现用户登录的示例代码
2019/11/26 PHP
javascript模拟select,jselect的方法实现
2012/11/08 Javascript
jquery中常用的SET和GET$(”#msg”).html循环介绍
2013/10/09 Javascript
javascript获取URL参数与参数值的示例代码
2013/12/20 Javascript
图片翻转效果具体实现代码
2014/01/09 Javascript
跟我学Nodejs(一)--- Node.js简介及安装开发环境
2014/05/20 NodeJs
js动态添加onclick事件可传参数与不传参数
2014/07/29 Javascript
JSON简介以及用法汇总
2016/02/21 Javascript
jQuery toggle 代替方法
2016/03/22 Javascript
Validform表单验证总结篇
2016/10/31 Javascript
整理关于Bootstrap排版的慕课笔记
2017/03/29 Javascript
Angular.js中控制器之间的传值详解
2017/04/24 Javascript
从零开始最小实现react服务器渲染详解
2018/01/26 Javascript
详解Vue This$Store总结
2018/12/17 Javascript
vue中通过使用$attrs实现组件之间的数据传递功能
2019/09/01 Javascript
JS实现拼图游戏
2021/01/29 Javascript
python之yield表达式学习
2014/09/02 Python
Python中的ctime()方法使用教程
2015/05/22 Python
python获取程序执行文件路径的方法(推荐)
2018/04/26 Python
Python读取stdin方法实例
2019/05/24 Python
python 将字符串完成特定的向右移动方法
2019/06/11 Python
Tensorflow模型实现预测或识别单张图片
2019/07/19 Python
150行Python代码实现带界面的数独游戏
2020/04/04 Python
tensorflow使用L2 regularization正则化修正overfitting过拟合方式
2020/05/22 Python
使用CSS媒体查询(Media Queries)和JavaScript判断浏览器设备类型的方法
2014/04/03 HTML / CSS
AmazeUI 折叠面板的实现代码
2020/08/17 HTML / CSS
打造高效课堂实施方案
2014/03/22 职场文书
汽车促销活动方案
2014/03/31 职场文书
节能减排倡议书
2014/04/15 职场文书
乡镇防汛工作汇报
2014/10/28 职场文书
大雁塔导游词
2015/02/04 职场文书
学期个人自我总结
2015/02/13 职场文书
WebWorker 封装 JavaScript 沙箱详情
2021/11/02 Javascript