python 中requests 模块用py2exe生成exe后SSL certificate exception的问题
[('system library', 'fopen', 'No such process'), ('BIO routines', 'BIO_new_file', 'no such file'), ('x509 certificate routines', 'X509_load_cert_crl_file', 'system lib')]
解决:
1) Place the below code in your main python file where “requests” module is used
os.environ['REQUESTS_CA_BUNDLE'] = "certifi/cacert.pem"
2) Within your distributable folder where exe is present, create a folder called “certifi” and place the “cacert.pem” file within it.
3) You can find the “cacert.pem” file by
pip install certifi
import certifi
certifi.where()
or you can copy it from python installation path, e.g. C:\Python27\Lib\site-packages\pip\_vendor\certifi
python 中requests 模块用py2exe生成exe后SSL certificate exception的问题的更多相关文章
- 关于解决Python中requests模块在PyCharm工具中导入问题
问题引入: 今天在学习Python网络请求的时候,导入requests模块时一直报红色波浪线,如图: 反复折腾,一直以为自己没有安装requests模块,反复安装反复卸载: 安装方法: 首先 cd 进 ...
- python中Requests模块中https请求在设置为忽略有效性验证,屏蔽告警信息的方式
增加下面的就ok了from requests.packages.urllib3.exceptions import InsecureRequestWarningrequests.packages.ur ...
- python中requests模块-params与data的区别
一般来说,params 在 get 请求中使用,data 在 post 请求中使用
- py2exe生成exe后,运行exe时提示No module named * 的解决办法
一个pymssql 的程序在解释器上运行正常,但是用py2exe打包后,提示 ImportError: No module named _mssql 百度了半天无果,然后bing,结果bing还是比百 ...
- Python中random模块生成随机数详解
Python中random模块生成随机数详解 本文给大家汇总了一下在Python中random模块中最常用的生成随机数的方法,有需要的小伙伴可以参考下 Python中的random模块用于生成随机数. ...
- Python中optionParser模块的使用方法[转]
本文以实例形式较为详尽的讲述了Python中optionParser模块的使用方法,对于深入学习Python有很好的借鉴价值.分享给大家供大家参考之用.具体分析如下: 一般来说,Python中有两个内 ...
- Python中的模块介绍和使用
在Python中有一个概念叫做模块(module),这个和C语言中的头文件以及Java中的包很类似,比如在Python中要调用sqrt函数,必须用import关键字引入math这个模块,下面就来了解一 ...
- Python爬虫之使用Fiddler+Postman+Python的requests模块爬取各国国旗
介绍 本篇博客将会介绍一个Python爬虫,用来爬取各个国家的国旗,主要的目标是为了展示如何在Python的requests模块中使用POST方法来爬取网页内容. 为了知道POST方法所需要传 ...
- python中confIgparser模块学习
python中configparser模块学习 ConfigParser模块在python中用来读取配置文件,配置文件的格式跟windows下的ini配置文件相似,可以包含一个或多个节(section ...
随机推荐
- elasticsearch 备份和恢复
curl : http://keenwon.com/1393.html During snapshot initialization, information about all previous ...
- E - Round Numbers
#include <iostream> #include <algorithm> #include <cstdio> #include <cstring> ...
- JToken和JObject有什么区别
JObject 用于操作JSON对象JArray 用语操作JSON数组JValue 表示数组中的值JProperty 表示对象中的属性,以"key/value"形式JT ...
- Python -3-列表和元组
1.用list就可以像修改列表那样修改字符串了 >>> list('Hello') ['H', 'e', 'l', 'l', 'o'] 可将任何序列作为list的参数 2.列表的 ...
- hdu6311( 2018 Multi-University Training Contest 2)
bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6311 从dls思路中,我整理一下自己的思路: 1.首先也是建图 2.建图结束后,一个df ...
- morphia(5)-删除
@Test public void delete() throws Exception { final Query<Employee> query = datastore.createQu ...
- jQuery position() 源码解读
position的代码比较简单... position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, el ...
- jquery中ajax请求后台数据成功后既不执行success也不执行error解决方法
jquery中ajax请求后台数据成功后既不执行success也不执行error,此外系统报错:Uncaught SyntaxError: Unexpected identifier at Objec ...
- APP产品体验
一.前言 1.背景介绍 体验人员:羽珞体验时间:2016.4.12~2016.4.14 2.体验环境 产品名称 产品版本 测试设备 设备系统 易助(ehlep) 1.0 TCL J738M A ...
- vs2013编译过程中,错误 59 error C4996: 'GetVersionExW': 被声明为已否决
好几次碰到这个错误,必须mark 一下!!!!!Project Properties > Configuration Properties > C/C++ > General > ...