pip安装py_zipkin时提示的SSL问题对应


Posted in Python onDecember 29, 2018

python的应用实践zipkin,需要py_zipkin,使用pip进行安装py_zipkin的时候出现问题, 根据stackoverflow的信息设定了pypi.org 和 files.pythonhosted.org解决了问题。

问题现象

[root@kong ~]# pip install py_zipkin
Collecting py_zipkin
 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),)': /packages/ef/87/e8fc3f124d491e635023a71f256769691037fc1451e5f5fb73846d6322d8/py_zipkin-0.11.0-py2.py3-none-any.whl
...省略
 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),)': /packages/ef/87/e8fc3f124d491e635023a71f256769691037fc1451e5f5fb73846d6322d8/py_zipkin-0.11.0-py2.py3-none-any.whl
Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/ef/87/e8fc3f124d491e635023a71f256769691037fc1451e5f5fb73846d6322d8/py_zipkin-0.11.0-py2.py3-none-any.whl (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),))
[root@kong ~]#

安装命令

pip install ?trusted-host pypi.org ?trusted-host files.pythonhosted.org py-zipkin

出现问题,需要安装python-devel,在ubuntu等上名为python-dev

[root@kong ~]# pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org py-zipkin
Collecting py-zipkin
 Downloading https://files.pythonhosted.org/packages/ef/87/e8fc3f124d491e635023a71f256769691037fc1451e5f5fb73846d6322d8/py_zipkin-0.11.0-py2.py3-none-any.whl
Collecting thriftpy (from py-zipkin)
...省略
 gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c thriftpy/transport/cybase.c -o build/temp.linux-x86_64-2.7/thriftpy/transport/cybase.o
 thriftpy/transport/cybase.c:13:20: fatal error: Python.h: No such file or directory
  #include "Python.h"

安装日志

再次执行,安装成功

[root@kong ~]# pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org py-zipkin
Collecting py-zipkin
 Downloading https://files.pythonhosted.org/packages/ef/87/e8fc3f124d491e635023a71f256769691037fc1451e5f5fb73846d6322d8/py_zipkin-0.11.0-py2.py3-none-any.whl
Requirement already satisfied: six in /usr/lib/python2.7/site-packages (from py-zipkin) (1.11.0)
Collecting thriftpy (from py-zipkin)
 Downloading https://files.pythonhosted.org/packages/f4/19/cca118cf7d2087310dbc8bd70dc7df0c1320f2652873a93d06d7ba356d4a/thriftpy-0.3.9.tar.gz (208kB)
  100% |################################| 215kB 2.0MB/s 
Requirement already satisfied: ply<4.0,>=3.4 in /usr/lib/python2.7/site-packages (from thriftpy->py-zipkin) (3.11)
Building wheels for collected packages: thriftpy
 Running setup.py bdist_wheel for thriftpy ... done
 Stored in directory: /root/.cache/pip/wheels/64/ff/0b/00a7ab5df78f8360908e34744eb78c2c537a327a295da5c260
Successfully built thriftpy
Installing collected packages: thriftpy, py-zipkin
Successfully installed py-zipkin-0.11.0 thriftpy-0.3.9
[root@kong ~]#

参考文档

https://stackoverflow.com/questions/25981703/pip-install-fails-with-connection-error-ssl-certificate-verify-failed-certi

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对三水点靠木的支持。如果你想了解更多相关内容请查看下面相关链接

Python 相关文章推荐
python去掉行尾的换行符方法
Jan 04 Python
Python3.4编程实现简单抓取爬虫功能示例
Sep 14 Python
Python开发中爬虫使用代理proxy抓取网页的方法示例
Sep 26 Python
Python通过future处理并发问题
Oct 17 Python
python之pandas用法大全
Mar 13 Python
Python3中详解fabfile的编写
Jun 24 Python
selenium+python实现自动化登录的方法
Sep 04 Python
浅谈Python 列表字典赋值的陷阱
Jan 20 Python
基于Python的ModbusTCP客户端实现详解
Jul 13 Python
Python中的引用和拷贝实例解析
Nov 14 Python
为什么称python为胶水语言
Jun 16 Python
python+selenium爬取微博热搜存入Mysql的实现方法
Jan 27 Python
Python 做曲线拟合和求积分的方法
Dec 29 #Python
python 画三维图像 曲面图和散点图的示例
Dec 29 #Python
python实现三维拟合的方法
Dec 29 #Python
Django数据库连接丢失问题的解决方法
Dec 29 #Python
Python Cookie 读取和保存方法
Dec 28 #Python
Python编程flask使用页面模版的方法
Dec 28 #Python
Python编程中flask的简介与简单使用
Dec 28 #Python
You might like
BBS(php &amp; mysql)完整版(七)
2006/10/09 PHP
php tp验证表单与自动填充函数代码
2012/02/22 PHP
PHP 年龄计算函数(精确到天)
2012/06/07 PHP
php基于jquery的ajax技术传递json数据简单实例
2016/04/15 PHP
Laravel4中的Validator验证扩展用法详解
2016/07/26 PHP
thinkPHP中volist标签用法示例
2016/12/06 PHP
php的4种常用运行方式详解
2016/12/22 PHP
Javascript图像处理思路及实现代码
2012/12/25 Javascript
JS过滤url参数特殊字符的实现方法
2013/12/24 Javascript
Node.js中HTTP模块与事件模块详解
2014/11/14 Javascript
检测一个函数是否是JavaScript原生函数的小技巧
2015/03/13 Javascript
JavaScript中的getTimezoneOffset()方法使用详解
2015/06/10 Javascript
详谈javascript异步编程
2016/02/21 Javascript
DOM操作和jQuery实现选项移动操作的简单实例
2016/06/07 Javascript
关于JS中二维数组的声明方法
2016/09/24 Javascript
ASP.NET jquery ajax传递参数的实例
2016/11/02 Javascript
js学习之----深入理解闭包
2016/11/21 Javascript
Bootstrap的modal拖动效果
2016/12/25 Javascript
js正则表达式验证密码强度【推荐】
2017/03/03 Javascript
浅谈Node.js CVE-2017-14849 漏洞分析(详细步骤)
2017/11/10 Javascript
微信小程序wx.uploadfile 本地文件转base64的实现代码
2018/06/28 Javascript
对vux点击事件的优化详解
2018/08/28 Javascript
vue中渲染对象中属性时显示未定义的解决
2020/07/31 Javascript
[50:58]2018DOTA2亚洲邀请赛3月29日 小组赛A组OpTic VS Newbee
2018/03/30 DOTA
Python+OpenCV实现车牌字符分割和识别
2018/03/31 Python
python人民币小写转大写辅助工具
2018/06/20 Python
深入了解Django中间件及其方法
2019/07/26 Python
django 单表操作实例详解
2019/07/30 Python
python计算波峰波谷值的方法(极值点)
2020/02/18 Python
linux比较文件内容的命令是什么
2013/03/04 面试题
办公室副主任岗位职责
2013/11/25 职场文书
高中化学教学反思
2014/01/13 职场文书
优秀老员工获奖感言
2014/02/15 职场文书
《云雀的心愿》教学反思
2014/02/25 职场文书
工作时间擅自离岗检讨书
2014/10/24 职场文书
工作保证书
2015/01/17 职场文书