D
D
Daulet2015-02-10 11:34:05
Python
Daulet, 2015-02-10 11:34:05

PyQt4, requests, why doesn't this bundle work when the exe file is built?

a pyqt4 python 2.7 program sends a request using the request library. Everything works when I run the py file, but when I collect everything in .exe using py2exe, the program does not work and gives
Traceback (most recent call last) to the log:
File "main.py", line 51, in send_sms
File "requests\api .pyc", line 65, in get
File "requests\api.pyc", line 49, in request
File "requests\sessions.pyc", line 461, in request
File "requests\sessions.pyc", line 573, in send
File "requests\adapters.pyc", line 431, in send
requests.exceptions.SSLError: [Errno 2] No such file or directory
here is my setup file

from distutils.core import setup
import py2exe
import requests


build_exe_options = {"include_files": [(requests.certs.where(), 'cacert.pem')]}
py2exe_options = {"bundle_files": 1}

setup(
    windows=[{"script":"main.py"}],
    # options={"py2exe": {"includes":["sip"]}},
    license='',
    install_requires=[
      'requests',
      'py2exe'
    ],
    options={"py2exe": {"includes":["sip"]}, "build_exe": build_exe_options},
    data_files=[('',[requests.certs.where()])]
)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Fateev, 2015-02-10
@svfat

Guess it can't find 'cacert.pem'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question