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

  • 相关阅读:
    查看虚拟机里的Centos7的IP
    display:none visibility:hidden opacity:0区别
    UVA
    Gym
    Gym
    UVALive
    面试题1
    vuex的5个属性值
    vue中的.sync语法糖
    绝对定位实现垂直居中的优缺点
  • 原文地址:https://www.cnblogs.com/feiwatson/p/9787874.html
Copyright © 2011-2022 走看看