4

I've compiled a Python screen saver on my Mac OS X 10.7 using py2app 0.6.3, but when I open the screen saver in System Preferences i get the following message:

You cannot use the Silly Balls screen saver on this computer.

I've read that this message means it needs to be compiled for 64-bit.

I'm running Python 2.7.1 64-bit on a 64-bit system.

How can I compile a 64-bit app with py2app that makes the screen saver example work?

Jason Sundram
  • 12,225
  • 19
  • 71
  • 86
Sindre Sorhus
  • 62,972
  • 39
  • 168
  • 232

1 Answers1

3

Something like this - note 'LSArchitecturePriority' : 'x86_64',

#cat ./setup.py 
"""
This is a setup.py script generated by py2applet

Usage:
    python setup.py py2app
"""

from setuptools import setup, find_packages

APP = ['YourApp.py']
DATA_FILES = []
OPTIONS = {
    'argv_emulation': False,
    'semi_standalone':'False',
    'optimize': 2,
    'includes': [
        ...
    ],
    'site_packages': 'True',
    'plist' : {
        'LSPrefersPPC' : False,
        'LSArchitecturePriority' : 'x86_64',
    }
}

setup(
    name = "YourApp",
    version = "0.0.4",
    author = "Iam",
    author_email = "info@test.com",
    description = ("An demonstration of how to create, document, and publish MacOS app"),
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)
Michael_XIII
  • 175
  • 1
  • 14
  • 1
    I'm having the same problem, and adding the LSArchitecturePriority option didn't do the trick for me. Does anyone have any other guesses? I found this link: http://developer.apple.com/library/mac/#qa/qa1666/_index.html but I'm not sure how to apply that suggestion to my setup.py file. – Stuart Berg Dec 25 '12 at 21:23
  • Sorry, @Jason, I didn't. I wrote to Ronald Oussoren (the main PyObjC developer), in [this email thread](http://mail.python.org/pipermail/pythonmac-sig/2012-December/023796.html). The issue seems to be that in OS 10.6 and OS 10.7, Apple's screensaver framework requires your code to be built with garbage collection enabled, but PyObjC doesn't support GC. – Stuart Berg Jun 09 '13 at 05:40
  • Furthermore, Apple has now changed their mind about GC. Newer frameworks (including the screensaver framework in 10.8) don't use it, so it would be a waste of time to add GC support to PyObjC at this point. Bottom line: PyObjC screensavers don't work in 10.6 and 10.7, but 10.5 and 10.8 should work (I personally haven't tried, though). – Stuart Berg Jun 09 '13 at 05:41
  • Thanks @superbatfish. I tried running [the SillyBalls demo](https://bitbucket.org/ronaldoussoren/pyobjc/src/78d315181dd4d7c7c18f366af5d7afb3b8583013/pyobjc-framework-ScreenSaver/Examples/SillyBallsSaver?at=default) on OSX 10.8.3 and had no luck. Maybe I'll follow up with Ron or the mailing list. – Jason Sundram Jun 10 '13 at 00:21
  • I contacted Jason Toffaletti, the developer of SillyBalls, and he's no longer working on osx development. So, no help there. – Jason Sundram Jun 10 '13 at 19:53