[('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环境下因SSL证书问题导致的请求失败。通过修改环境变量、创建certifi文件夹并放置cacert.pem文件,确保requests模块正常运行。
31万+

被折叠的 条评论
为什么被折叠?



