py2app crashes when "requests" is used

29 Views Asked by At

In Python 3.11, when the program runs to this requests related code:

resp = requests.put(login_url, json=data)

I get this error:

zsh: segmentation fault /Users/luyiming/Desktop/SaQt/dist/app.app/Contents/MacOS/app

setup.py:

from setuptools import setup

APP = ['app.py']
DATA_FILES = ['./main_w.ui', './login.ui']
OPTIONS = {
    'includes': ['requests', 'idna', 'certifi', 'charset_normalizer.md__mypyc', 'PyQt5.QtCore', 'PyQt5.QtWidgets'],
    'packages': ['requests', 'gevent', 'greenlet'],
}

setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app']
)

0

There are 0 best solutions below