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

Permission denied error while running setup.py py2app #510

Open
fluffy-critter opened this issue Oct 10, 2023 · 1 comment
Open

Permission denied error while running setup.py py2app #510

fluffy-critter opened this issue Oct 10, 2023 · 1 comment

Comments

@fluffy-critter
Copy link

Hi, I'm trying to set up a build on an app using wxPython. My Python installation is managed by Homebrew, and I'm using poetry to manage my development environment.

When I run poetry run python3 setup.py py2app I get a lot of build output, which ends with the error:

error: [Errno 13] Permission denied: '/Users/fluffy/projects/bandcrash/dist/Bandcrash.app/Contents/Resources/lib/python3.11/lib-dynload/../../../../../../../../../../opt'

If I try to run the resulting .app file I get an error dialog which reads, "A Python runtime not could be located. You may need to install a framework build of Python, or edit the PyRuntimeLocations array in this application's Info.plist file." From the error it seems that it's attempting to pull in the Python3 installation (in /opt/homebrew) using some relative paths.

My setup.py is as follows, adapted from the guide at https://py2app.readthedocs.io/en/latest/examples.html:

import sys
import os.path
from setuptools import setup

mainscript=os.path.join('bandcrash','gui.py')

if sys.platform == 'darwin':
     extra_options = dict(
         setup_requires=['py2app'],
         app=[mainscript],
         options=dict(py2app=dict(argv_emulation=True)),
     )
elif sys.platform == 'win32':
     extra_options = dict(
         setup_requires=['py2exe'],
         app=[mainscript],
     )
else:
     extra_options = dict(
         scripts=[mainscript],
     )

setup(
    packages=["bandcrash"],
    name="Bandcrash",
    **extra_options
)
@fluffy-critter
Copy link
Author

Just as a check I tried building the superdoodle app from the py2app examples, and had the same error, with both Python 3.11 and 3.10.

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

1 participant