1

我正在打包我们的 Python 应用程序,而 Mac 上的 Py2App 不包括构成我们应用程序基础的 CefPython 库。从我在应用程序内容中可以看到,它包括整个 Python3 库,但不包括 CEFPython。如何在 setup.py 中添加 CefPython?目前,当我生成 .app 文件并执行它时,我收到一个错误,Mac 询问我是否要打开控制台。我在 install.log 中什么也看不到

设置.py:

"""
This is a setup.py script generated by py2applet

Usage:
    python setup.py py2app
"""

from setuptools import setup

    APP = ['Our_APP.py']
    DATA_FILES = []
    OPTIONS = {}

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

更新的脚本

This is a setup.py script generated by py2applet

Usage:
    python setup.py py2app


from setuptools import setup

APP = ['20notes.py']
DATA_FILES = []
OPTIONS = {'packages':['cefpython3','objc']}

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

更新错误:

Traceback (most recent call last):
  File "setup.py", line 18, in <module>
    setup_requires=['py2app','cefpython3'],
TypeError: None is not a string

我试过删除逗号,删除 cefpython3 选项,没有任何效果。任何想法。谢谢你。

4

1 回答 1

1

尝试将“cefpython3”包添加到选项:

OPTIONS = {
    'packages' : ['cefpython3', 'objc'],
}

也设置这个:

os.environ['MACOSX_DEPLOYMENT_TARGET'] = "10.9"
于 2018-05-24T09:08:21.017 回答