简体   繁体   中英

App crashes on launch after compiled by py2app if 'requests' is included

My.app launches if i don't have the requests module imported into my app, but if it's included it crashes when trying to launch the.app compiled by py2app. I've tried to include requests into Setup.py and it still crashes.

i have py2app-0.21 installed.Running Python 3.6.4, MacOs Catalina 10.15.14

error log from console:

(org.pythonmac.unspecified.testapp.2888[62145]): Service exited with abnormal code: 255

Setup.py

from setuptools import setup

    APP = ['test.py']
    DATA_FILES = []

    OPTIONS = {

        'argv_emulation': True,
        'includes': ['requests'],
        'packages': ['requests', 'rumps']

    }

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

The unspecified.testapp part of your error log tells me that you need to tell python where your app file actually is (relative path? absolute path? that will depend on your usecase)

Use some pathname manipulation to point to test.py

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM