zoukankan      html  css  js  c++  java
  • 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:Python27Libsite-packagespip\_vendorcertifi

  • 相关阅读:
    旅行
    赛道修建
    逃学的小孩
    hdu4035_概率dp
    hdu4405_概率dp
    poj2096_概率dp
    poj3420_找规律+矩阵快速幂
    poj2411_状压dp
    poj3744_矩阵快速幂
    hdu5720_贪心
  • 原文地址:https://www.cnblogs.com/feiwatson/p/9787874.html
Copyright © 2011-2022 走看看