3

I've been trying to create an executable on Mac this morning. I have been following the instructions on the Py2app website and have successfully created the setup.py file and a .app file for my program named "Density.app"

When I try to open the .app using any of the methods mentioned on the py2app website, along with double-clicking the "density.app" file itself I get a pop-up window that says "Density Error" and contains two buttons. One says "Terminate" the other "Open Console".

The console contains the following:

1/31/16 2:50:56.487 PM Density[987]: argvemulator warning: processing events failed
1/31/16 2:50:56.505 PM Density[987]: Traceback (most recent call last):
1/31/16 2:50:56.505 PM Density[987]: File"/Users/jared/dist/Density.app/Contents/Resources/__boot__.py", line 398, in <module>
1/31/16 2:50:56.505 PM Density[987]: _run() 
1/31/16 2:50:56.505 PM Density[987]: File "/Users/jared/dist/Density.app/Contents/Resources/__boot__.py", line 383, in _run
1/31/16 2:50:56.505 PM Density[987]: with open(script, 'rU') as fp:
1/31/16 2:50:56.506 PM Density[987]: IOError: [Errno 2] No such file or directory: '/Users/jared/Density.py'
1/31/16 2:50:56.574 PM Density[987]: Density Error
1/31/16 2:50:56.574 PM Density[987]: 2016-01-31 14:50:56.573 Density[987:70683] Density Error

and my setup.py file contains the following:

from setuptools import setup

APP = ['Density.py']
DATA_FILES = ['Body']
OPTIONS = {'argv_emulation': True}

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

Any help would be greatly appreciated. I've never done something like this, and I am new to using Macs, I've always used Windows, so even the whole terminal thing is a continuing learning experience for me. Thanks ahead of time.

Rouxgrr
  • 35
  • 1
  • 7
  • So where is `Density.py`? – cdarke Jan 31 '16 at 23:00
  • It's in: Users/jared/PyCharmProjects/BodyFat/Body Density.py When I created the .app file it just used the name "Density.app" That file is located in: Users/jared/dist/density Edit: I'm not sure how to make the path in a code section like you did. – Rouxgrr Jan 31 '16 at 23:15
  • I don't know `py2app`, but obviously it is expecting the file to be in your home directory. Have you tried moving it there? – cdarke Feb 01 '16 at 07:49
  • Well I finally got it to work from the Terminal. I think the problem I wasn't navigated into that directory. The program just wont work when I click on it from the dir folder. – Rouxgrr Feb 04 '16 at 06:50

0 Answers0