Include CefPython library in setup.py

133 Views Asked by At

I am working on packaging our Python app and Py2App on Mac is not including CefPython library which forms the basis of our app. From what I can see in the app contents, it includes the entire Python3 library, but not CEFPython. How can I add CefPython in setup.py? Currently, when I am generating the .app file and executing it, I get an error and Mac asks me if I want to open the console. I see nothing in install.log

setup.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'],
    )

Updated script

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']
)

Updated error :

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

I have tried removing the comma, removing cefpython3 option, nothing works. Any idea. THank you.

1

There are 1 best solutions below

7
On

Try adding 'cefpython3' package to OPTIONS:

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

Also set this:

os.environ['MACOSX_DEPLOYMENT_TARGET'] = "10.9"