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编写检测数据库SA用户的方法
Jul 11 Python
python定时关机小脚本
Jun 20 Python
编写多线程Python服务器 最适合基础
Sep 14 Python
python退出命令是什么?详解python退出方法
Dec 10 Python
深入浅析Python 中 is 语法带来的误解
May 07 Python
python列表插入append(), extend(), insert()用法详解
Sep 14 Python
Python帮你微信头像任意添加装饰别再@微信官方了
Sep 25 Python
PyCharm无法引用自身项目解决方式
Feb 12 Python
python GUI库图形界面开发之PyQt5拖放控件实例详解
Feb 25 Python
使用pyplot.matshow()函数添加绘图标题
Jun 16 Python
Python+Appium实现自动化清理微信僵尸好友的方法
Feb 04 Python
Python3+Django get/post请求实现教程详解
Feb 16 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
php session安全问题分析
2011/06/24 PHP
php利用反射实现插件机制的方法
2015/03/14 PHP
php 读取输出其他文件的实现方法
2016/07/26 PHP
php使用变量动态创建类的对象用法示例
2017/02/06 PHP
php桥接模式应用案例分析
2019/10/23 PHP
thinkphp5 + ajax 使用formdata提交数据(包括文件上传) 后台返回json完整实例
2020/03/02 PHP
如何取得中文输入的真实长度?
2006/06/24 Javascript
JavaScript入门教程 Cookies
2009/01/31 Javascript
JavaScript初学者需要了解10个小技巧
2010/08/25 Javascript
详解JavaScript函数
2015/12/01 Javascript
三种带箭头提示框总结实例
2016/06/14 Javascript
javascript中sort排序实例详解
2016/07/24 Javascript
WebSocket+node.js创建即时通信的Web聊天服务器
2016/08/08 Javascript
vue使用mint-ui实现下拉刷新和无限滚动的示例代码
2017/11/06 Javascript
推荐10款扩展Web表单的JS插件
2017/12/25 Javascript
详释JavaScript执行环境与执行栈
2019/04/02 Javascript
vue cli3 配置proxy代理无效的解决
2019/10/30 Javascript
在Python中使用异步Socket编程性能测试
2014/06/25 Python
python端口扫描系统实现方法
2014/11/19 Python
Python实现比较两个列表(list)范围
2015/06/12 Python
详解C++编程中一元运算符的重载
2016/01/19 Python
详解Python多线程Selenium跨浏览器测试
2017/04/01 Python
Python实现EXCEL表格的排序功能示例
2019/06/25 Python
Python利用matplotlib做图中图及次坐标轴的实例
2019/07/08 Python
DJango的创建和使用详解(默认数据库sqlite3)
2019/11/18 Python
PyQt5如何将.ui文件转换为.py文件的实例代码
2020/05/26 Python
keras 使用Lambda 快速新建层 添加多个参数操作
2020/06/10 Python
Keras实现DenseNet结构操作
2020/07/06 Python
Python数据可视化常用4大绘图库原理详解
2020/10/23 Python
Python3.9最新版下载与安装图文教程详解(Windows系统为例)
2020/11/28 Python
销售冠军获奖感言
2014/02/03 职场文书
会走路的树教学反思
2014/02/20 职场文书
《凡卡》教学反思
2014/04/09 职场文书
小学秋季运动会报道稿
2014/09/30 职场文书
上帝为你开了一扇窗之Tkinter常用函数详解
2021/06/02 Python
九大龙王魂骨,山龙王留下躯干骨,榜首死的最憋屈(被捏碎)
2022/03/18 国漫