python requests can't find a folder with a certificate when converted to .exe

前端 未结 2 1416
生来不讨喜
生来不讨喜 2021-01-04 18:21

I have a program that pools ad stats from different marketing systems. Everything works fine untill i convert it to the .exe format and run it.

Exception in          


        
2条回答
  •  無奈伤痛
    2021-01-04 18:55

    This might be issue with requests package.

    I solved this by manually copying the cacert.pem file from /lib/site-packages/certifi to /lib/site-packages/requests

    If you want to fix this issue with .exe, then cacert.pem file from /lib/site-packages/certifi to dist/library.zip/certifi/.

    I am considering you have created exe using py2exe, where py2exe will create library.zip under dist/ which contains of all script dependencies. I don't know if other exe converters create library.zip.

    Hope this helps.

提交回复
热议问题