Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does anyone know how to fix a "(no such file), '/System/Library/Carbon.framework/Carbon' (no such file, not in dyld cache)" error? #208

Open
Dima-369 opened this issue Oct 11, 2023 · 5 comments

Comments

@Dima-369
Copy link

This happens on a M1 macOS 14.0.

test.py

import rumps


class BarApp(rumps.App):
    @rumps.clicked("Test")
    def test(self, _):
        rumps.alert("Now click BarApp twice, then click OK.\nResult: segfault")

       
BarApp("BarApp").run()

setup.py

from setuptools import setup

APP = ['test.py']
DATA_FILES = []
OPTIONS = {
    'argv_emulation': True,
    'plist': {
        'LSUIElement': True,
    },
    'packages': ['rumps'],
}

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

The error

~/rumps test/dist/test.app/Contents/MacOS $ ./test

Traceback (most recent call last):
  File "/Users/dima/rumps test/dist/test.app/Contents/Resources/__boot__.py", line 321, in <module>
    _argv_emulation()
  File "/Users/dima/rumps test/dist/test.app/Contents/Resources/__boot__.py", line 318, in _argv_emulation
    _run_argvemulator()
  File "/Users/dima/rumps test/dist/test.app/Contents/Resources/__boot__.py", line 127, in _run_argvemulator
    carbon = _ctypes_setup()
             ^^^^^^^^^^^^^^^
  File "/Users/dima/rumps test/dist/test.app/Contents/Resources/__boot__.py", line 51, in _ctypes_setup
    carbon = ctypes.CDLL("/System/Library/Carbon.framework/Carbon")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "ctypes/__init__.pyc", line 376, in __init__
OSError: dlopen(/System/Library/Carbon.framework/Carbon, 0x0006): tried: '/System/Library/Carbon.framework/Carbon' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/System/Library/Carbon.framework/Carbon' (no such file), '/System/Library/Carbon.framework/Carbon' (no such file, not in dyld cache)
2023-10-11 21:16:10.885 test[81802:3058374] Launch error
2023-10-11 21:16:10.885 test[81802:3058374] Launch error
See the py2app website for debugging launch issues
@jksmx
Copy link

jksmx commented Oct 26, 2023

Same problem

@QAInsights
Copy link

QAInsights commented Nov 18, 2023

Same here for M2.

@QAInsights
Copy link

@Dima-369 @jksmx I fixed the issue. Here is my setup.py. Please make sure that 'argv_emulation' is False as shown below and DATA_FILES must be list[tuple[str, list[str]]].

This is my Hamster project. Hope I saved your day :)

APP = ['hamster/__main__.py']
APP_NAME = 'Hamster'
DATA_FILES = [('', ['hamster/app.properties']), ('img', ['hamster/img/hamster.png'])]
OPTIONS = {
    'argv_emulation': False,
    'iconfile': 'hamster/img/hamster.png',
    'plist': {
        'LSUIElement': True,
    },
    'packages': ['rumps', 'configparser', 'plistlib', 'os', 're', 'pathlib', 'psutil'],
}

@Dima-369
Copy link
Author

Please make sure that 'argv_emulation' is False

Cool, this also works for me. Thanks 🙂

@matagus
Copy link

matagus commented Nov 23, 2023

this worked for me too, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants