简体   繁体   English

如果包含“请求”,则应用程序在由 py2app 编译后在启动时崩溃

[英]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.如果我没有将 requests 模块导入我的应用程序,则 My.app 会启动,但如果包含它,则会在尝试启动由 py2app 编译的.app 时崩溃。 I've tried to include requests into Setup.py and it still crashes.我试图将请求包含到 Setup.py 中,但它仍然崩溃。

i have py2app-0.21 installed.Running Python 3.6.4, MacOs Catalina 10.15.14我安装了 py2app-0.21。运行 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安装程序.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)错误日志的 unspecified.testapp 部分告诉我,您需要告诉 python 您的应用程序文件实际在哪里(相对路径?绝对路径?这取决于您的用例)

Use some pathname manipulation to point to test.py使用一些路径名操作指向test.py

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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