py2app

Python: Making a standalone executable file on MacOS with py2app

亡梦爱人 提交于 2019-12-05 17:39:40
I have an application in a python script my_app.py and want to make a standalone executable out of it on a MacOS (10.14). Following the video-tutorial here , I entered sequentially the following commmands: pip install virtualenv virtualenv venv --system-site-packages source venv/bin/activate pip install py2app cd /path/to/my_app.py python setup.py py2app -A with the following setup.py file: from setuptools import setup APP = ["my_app.py"] DATA_FILES = [] OPTIONS = { "argv_emulation": True, "packages": ["certifi"], } setup( app = APP, data_files = DATA_FILES, options = {"py2app": OPTIONS},

Can executables made with py2app include other terminal scripts and run them?

情到浓时终转凉″ 提交于 2019-12-05 13:30:59
问题 So I have a nice python app for OS X that is working great. It runs an external terminal script and I would like to include that in with my python app. Ideally, I'd be able to run py2app and have this script bundled up with it into the executable and then be able to include it and run it in the python portion of my code. Is this possible? Thanks in advance! Extra Edit: The script that I am using is compiled. I can't just look inside and paste it. 回答1: See http://svn.pythonmac.org/py2app

OSX app built with python quits immediately if app bundle is executed from finder but runs fine from command line

走远了吗. 提交于 2019-12-05 12:28:37
So I have this pyqt project and I want to build a osx.app dmg using pyinstaller pyinstaller created the output in dist/MyApplication.app I can run it directly from terminal cd dist ./MyApplication.app/Contents/MacOS/MyApplication However, if I try to run the app bundle directly either with open -a MyApplication.app or open . # double click on MyApplication.app folder (appears just as MyApplication from finder) It starts and then quits immediately Now if I navigate to $ cd ./Contents/MacOS/ and open a finder $ open . #then double click on MyApplication it runs fine, but with a terminal windows

PIL ImageTK not loading image in py2app application bundle

时间秒杀一切 提交于 2019-12-05 08:01:19
I'm testing out an app that I've made which, amongst other things, loads a couple of .png images when opened. The images are displayed correctly on my Mac (10.7.5) and my mother's (10.8.5); however when my sister opens it on hers (10.9.5) the images don't load. All other functionality is otherwise intact. I should note that on my Mac and my mother's, I installed Python 3.4 and many of the packages that the app uses, including the PIL package, whereas my sister has none of these. The app was build using the command: python3.4 setup.py py2app Images are imported in the code with: image = ImageTk

py2app setup.py usage question

﹥>﹥吖頭↗ 提交于 2019-12-05 03:01:44
问题 Ok so I'm trying to use py2app to generate a distribution for my project. I'm still not sure I get the hang of it tho. So my setup.py looks like this: """ This is a setup.py script generated by py2applet Usage: python setup.py py2app """ from setuptools import setup import setuptools PACKAGES = ['sqlalchemy.dialects.sqlite'] MODULES = ['sqlite3'] APP = ['tvb/interfaces/web/run.py'] OPTIONS = {'argv_emulation': True, 'packages': PACKAGES , 'includes' : MODULES } DATA_FILES = [] setup( app=APP,

Slim down Python wxPython OS X app built with py2app?

北城余情 提交于 2019-12-04 20:13:59
I have just made a small little app of a Python wxPython script with py2app. Everything worked as advertised, but the app is pretty big in size. Is there any way to optimize py2app to make the app smaller in size? This is a workaround. It will depend on which OS you want to target. Python and wxPython are bundled with every Mac OS X installation (at least starting with Leopard, if I recall correctly) What you might try, is to add the --alias compilation option. According to the py2app doc : Alias mode (the -A or --alias option) instructs py2app to build an application bundle that uses your

Problem using py2app with the lxml package

廉价感情. 提交于 2019-12-04 13:14:36
问题 I am trying to use 'py2app' to generate a standalone application from some Python scripts. The Python uses the 'lxml' package, and I've found that I have to specify this explicitly in the setup.py file that 'py2app' uses. However, the resulting application program still won't run on machines that haven't had 'lxml' installed. My Setup.py looks like this: from setuptools import setup OPTIONS = {'argv_emulation': True, 'packages' : ['lxml']} setup(app=[MyApp.py], data_files=[], options={'py2app

Can executables made with py2app include other terminal scripts and run them?

隐身守侯 提交于 2019-12-04 01:56:37
So I have a nice python app for OS X that is working great. It runs an external terminal script and I would like to include that in with my python app. Ideally, I'd be able to run py2app and have this script bundled up with it into the executable and then be able to include it and run it in the python portion of my code. Is this possible? Thanks in advance! Extra Edit: The script that I am using is compiled. I can't just look inside and paste it. See http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html#option-reference and look at the --resources parameter. For example: python setup.py

Building a Mac and Windows GUI Application

徘徊边缘 提交于 2019-12-03 16:51:26
问题 I am planning to build a GUI application for Mac and Windows. I've been doing some research in the technology choices, as in the language, libraries, and build tools, so that I can share as much code as possible between the two platforms. The main requirements are: Meets the Mac App Store requirements. Native look and feel on both Mac and Windows. Need to call into Quartz Window Services on Mac and the Windows API on Windows. Store and read data using SQLite. The length of my post has gotten

tkinter/py2app created application doesn't show window on initial launch

限于喜欢 提交于 2019-12-03 16:32:53
I'm running into an issue where launching a python app created with Tkinter and packaged by py2app doesn't show the application window immediately. The only way I've gotten the window to show after launch is to click on the application icon in the dock. This guy is using an applescript to auto-click the app on launch but as he states, and I agree, it isn't ideal. After doing some extensive research, it would appear that this is a result of setting the 'argv_emulation' option to True in the, py2app, setup.py file. 来源: https://stackoverflow.com/questions/12992316/tkinter-py2app-created