From nad at acm.org Sat Jan 1 22:36:22 2011 From: nad at acm.org (Ned Deily) Date: Sat, 01 Jan 2011 13:36:22 -0800 Subject: [Pythonmac-SIG] PytDev intro documentation review? References: <4D1BA473.6050503@cogsci.ucsd.edu> Message-ID: In article <4D1BA473.6050503 at cogsci.ucsd.edu>, richard k belew wrote: > Item#3 has to do with the Mac install of Python. here > i lay out two alternatives, one using the standard system > installed Python and the other installing the standard Python > release. since my ultimate goal is to simply get the PyDev > plugin for Eclipse operational, and PyDev says it'll work > with any Python >= 2.1, this SEEMs safe. > > do y'all agree? any other suggestions? Why build Python 2.7.1 from source? Just download the 32-bit-only OS X installer from python.org. See here: http://www.python.org/download/releases/2.7.1/ At the moment for instructional purposes, I would strongly suggest only using the 32-bit installer on all versions of OS X from 10.3.9 through 10.6 and avoiding the 64-bit installer as the latter has issues with Tkinter and IDLE. Unfortunately, http://www.python.org/download/mac/ is rather old and in need of updating. -- Ned Deily, nad at acm.org From ian at auricom.com Sun Jan 2 18:56:16 2011 From: ian at auricom.com (Ian McLean) Date: Sun, 2 Jan 2011 12:56:16 -0500 Subject: [Pythonmac-SIG] made app using py2app, can't pass arguments properly Message-ID: <1039C916-1AF4-4189-B2C7-C30149BF0D76@auricom.com> Hi, I'm new to python/py2app. My original python script accepts arguments as such: python merge.py -o outfile.txt - i infile1.txt infile2.txt Once I create the .app from py2app using argv emulation this no longer works and I get the following feedback: new-host:dist Ian$ merge -o outfile.txt -i infile1.txt infile2.txt merge: unknown option: -o merge: usage: merge [-AeEpqxX3] [-L lab [-L lab [-L lab]]] file1 file2 file3 merge: too many arguments this is the setup.py that py2app generated automatically """ This is a setup.py script generated by py2applet Usage: python setup.py py2app """ from setuptools import setup APP = ['merge.py'] DATA_FILES = [] OPTIONS = {'argv_emulation': True} setup( app=APP, data_files=DATA_FILES, options={'py2app': OPTIONS}, setup_requires=['py2app'], ) Any idea what I'm doing wrong? Thanks in advance! From nad at acm.org Sun Jan 2 22:49:43 2011 From: nad at acm.org (Ned Deily) Date: Sun, 02 Jan 2011 13:49:43 -0800 Subject: [Pythonmac-SIG] made app using py2app, can't pass arguments properly References: <1039C916-1AF4-4189-B2C7-C30149BF0D76@auricom.com> Message-ID: In article <1039C916-1AF4-4189-B2C7-C30149BF0D76 at auricom.com>, Ian McLean wrote: > I'm new to python/py2app. My original python script accepts arguments as > such: > > python merge.py -o outfile.txt - i infile1.txt infile2.txt > > Once I create the .app from py2app using argv emulation this no longer works > and I get the following feedback: > > new-host:dist Ian$ merge -o outfile.txt -i infile1.txt infile2.txt > merge: unknown option: -o > merge: usage: merge [-AeEpqxX3] [-L lab [-L lab [-L lab]]] file1 file2 file3 > merge: too many arguments You are undoubtedly running the system-supplied merge command (/usr/bin/merge) rather than your app. In general, OS X apps, including those created with py2app, are designed to be "launched", for example from the Finder by clicking on their icon, rather than run from a command line. You *can* launch apps from the command line, for instance, with the open command (see man 1 open), or by "going under the covers" into the app bundle and executing the main executable file inside it. But if your intent is to just produce a command-line callable utility, then you probably don't want to be using py2app. The more conventional cross-platform approach using python's Distutils should be fine. Or if it's just a one-file script, add a shebang line to the file and make it executable: $ cat mymerge #!/usr/bin/env python # import ... $ chmod 755 mymerge $ ./mymerge -o ... -- Ned Deily, nad at acm.org From elguavas at gmail.com Tue Jan 4 00:36:56 2011 From: elguavas at gmail.com (Stephen Gava) Date: Tue, 04 Jan 2011 10:36:56 +1100 Subject: [Pythonmac-SIG] python3.2 osx build In-Reply-To: References: <1039C916-1AF4-4189-B2C7-C30149BF0D76@auricom.com> Message-ID: <4D225D98.8020801@gmail.com> hi all, i'm guessing that since there was never a 3.2 beta 2 build for osx released, and since it's the holiday season, and since 3.2 rc1 is due in just 4 days now, that beta 1 has been / will be simply skipped for osx...? anyone know? or know if there will even be an rc1 build for osx released? cheers, stephen. From nad at acm.org Tue Jan 4 02:26:29 2011 From: nad at acm.org (Ned Deily) Date: Mon, 03 Jan 2011 17:26:29 -0800 Subject: [Pythonmac-SIG] python3.2 osx build References: <1039C916-1AF4-4189-B2C7-C30149BF0D76@auricom.com> <4D225D98.8020801@gmail.com> Message-ID: In article <4D225D98.8020801 at gmail.com>, Stephen Gava wrote: > i'm guessing that since there was never a 3.2 beta 2 build for osx > released, and since it's the holiday season, and since 3.2 rc1 is due in > just 4 days now, that beta 1 has been / will be simply skipped for osx...? Yes, unfortunately, 3.2b2 has not appeared yet. FWIW, the beta 1 installer is still available here: http://www.python.org/ftp/python/3.2/python-3.2b1-macosx10.3.dmg > anyone know? or know if there will even be an rc1 build for osx released? I'm sure there will be an rc1 installer. -- Ned Deily, nad at acm.org From njriley at illinois.edu Tue Jan 4 04:27:09 2011 From: njriley at illinois.edu (Nicholas Riley) Date: Mon, 3 Jan 2011 21:27:09 -0600 Subject: [Pythonmac-SIG] py2app looking for ae.so in the wrong place Message-ID: <20110104032709.GA1255@illinois.edu> I finally upgraded my iMac from 10.5 to 10.6 and tried to recompile one of my py2app apps with the system Python 2.6.1 and current py2app. The application uses appscript, but for some reason it's trying to import ae.so from /System: % dist/StreamVision.app/Contents/MacOS/StreamVision Traceback (most recent call last): File "/Users/nicholas/Documents/Development/StreamVision/dist/StreamVision.app/Contents/Resources/__boot__.py", line 31, in _run('StreamVision.py') File "/Users/nicholas/Documents/Development/StreamVision/dist/StreamVision.app/Contents/Resources/__boot__.py", line 28, in _run execfile(path, globals(), globals()) File "/Users/nicholas/Documents/Development/StreamVision/dist/StreamVision.app/Contents/Resources/StreamVision.py", line 4, in from appscript import app, k, its, CommandError File "appscript/__init__.pyc", line 8, in File "aem/__init__.pyc", line 5, in File "aem/ae.pyc", line 18, in File "aem/ae.pyc", line 15, in __load ImportError: '/System/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/lib-dynload/aem/ae.so' not found 2011-01-03 21:23:47.306 StreamVision[82885:903] StreamVision Error ae.so is indeed in the app package: % ls **/ae.so dist/StreamVision.app/Contents/Resources/lib/python2.6/lib-dynload/aem/ae.so Any ideas what's going on here? Everything worked fine on 10.5 with Python 2.5. -- Nicholas Riley From cweisiger at msg.ucsf.edu Tue Jan 4 21:21:12 2011 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Tue, 4 Jan 2011 12:21:12 -0800 Subject: [Pythonmac-SIG] Escaping commandline strings Message-ID: I want to sanitize some strings (e.g. escape apostrophes, spaces, etc.) before passing them to the commandline via subprocess. Unfortunately I can't seem to find any built-in function to do this. Am I really going to have to write up my own sanitizer? Not that it'd be much effort, but I'd much rather use an official function than risk forgetting something. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From cs at zip.com.au Tue Jan 4 22:20:51 2011 From: cs at zip.com.au (Cameron Simpson) Date: Wed, 5 Jan 2011 08:20:51 +1100 Subject: [Pythonmac-SIG] Escaping commandline strings In-Reply-To: References: Message-ID: <20110104212051.GA22579@cskk.homeip.net> On 04Jan2011 12:21, Chris Weisiger wrote: | I want to sanitize some strings (e.g. escape apostrophes, spaces, etc.) | before passing them to the commandline via subprocess. Unfortunately I can't | seem to find any built-in function to do this. Am I really going to have to | write up my own sanitizer? Not that it'd be much effort, but I'd much rather | use an official function than risk forgetting something. If it is for Bourne shell syntax, it's almost too simple to put in a library: put into single quotes and replace all inner single quotes with: '\'' You can play games with strings that are safe to not quote, etc but the above is very simple and reliable. Something like (untested): "'"+s.replace("'", "'\\''")+"'" Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ You Know You're in the SCA When... ...the tunes you unconsciously hum are in Latin. - Cailfind ingen Grainne From cweisiger at msg.ucsf.edu Tue Jan 4 22:41:33 2011 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Tue, 4 Jan 2011 13:41:33 -0800 Subject: [Pythonmac-SIG] Escaping commandline strings In-Reply-To: <20110104212051.GA22579@cskk.homeip.net> References: <20110104212051.GA22579@cskk.homeip.net> Message-ID: A friend just pointed me to pipes.quote(). Is there any reason I shouldn't just use that? And given the number of rather simple things that are already in the standard library (e.g. capitalize the first letter of a string), simplicity isn't really an excuse for excluding this functionality. Especially since doing this wrong leaves you open to security issues. -Chris On Tue, Jan 4, 2011 at 1:20 PM, Cameron Simpson wrote: > On 04Jan2011 12:21, Chris Weisiger wrote: > | I want to sanitize some strings (e.g. escape apostrophes, spaces, etc.) > | before passing them to the commandline via subprocess. Unfortunately I > can't > | seem to find any built-in function to do this. Am I really going to have > to > | write up my own sanitizer? Not that it'd be much effort, but I'd much > rather > | use an official function than risk forgetting something. > > If it is for Bourne shell syntax, it's almost too simple to put in a > library: put into single quotes and replace all inner single quotes > with: > > '\'' > > You can play games with strings that are safe to not quote, etc but the > above is very simple and reliable. Something like (untested): > > "'"+s.replace("'", "'\\''")+"'" > > Cheers, > -- > Cameron Simpson DoD#743 > http://www.cskk.ezoshosting.com/cs/ > > You Know You're in the SCA When... > ...the tunes you unconsciously hum are in Latin. > - Cailfind ingen Grainne > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Tue Jan 4 22:56:17 2011 From: nad at acm.org (Ned Deily) Date: Tue, 04 Jan 2011 13:56:17 -0800 Subject: [Pythonmac-SIG] Escaping commandline strings References: Message-ID: In article , Chris Weisiger wrote: > I want to sanitize some strings (e.g. escape apostrophes, spaces, etc.) > before passing them to the commandline via subprocess. Unfortunately I can't > seem to find any built-in function to do this. Am I really going to have to > write up my own sanitizer? Not that it'd be much effort, but I'd much rather > use an official function than risk forgetting something. The subprocess doc show how to use shlex to parse a shell-like command string. I'm not sure I understand your use case but is there a reason you can't use 'shell=False' and set up the arguments yourself, thus avoiding the need for escapes? Even if you really need to have a shell execute the string, you should be able to set up the arguments and call the shell directly. http://docs.python.org/library/subprocess.html -- Ned Deily, nad at acm.org From cweisiger at msg.ucsf.edu Tue Jan 4 23:23:16 2011 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Tue, 4 Jan 2011 14:23:16 -0800 Subject: [Pythonmac-SIG] Escaping commandline strings In-Reply-To: References: Message-ID: On Tue, Jan 4, 2011 at 1:56 PM, Ned Deily wrote: > In article > , > Chris Weisiger wrote: > > I want to sanitize some strings (e.g. escape apostrophes, spaces, etc.) > > before passing them to the commandline via subprocess. Unfortunately I > can't > > seem to find any built-in function to do this. Am I really going to have > to > > write up my own sanitizer? Not that it'd be much effort, but I'd much > rather > > use an official function than risk forgetting something. > > The subprocess doc show how to use shlex to parse a shell-like command > string. I'm not sure I understand your use case but is there a reason > you can't use 'shell=False' and set up the arguments yourself, thus > avoiding the need for escapes? Even if you really need to have a shell > execute the string, you should be able to set up the arguments and call > the shell directly. > > http://docs.python.org/library/subprocess.html > What I'm doing here is writing out a shell script for each of a list of files I'm processing. The shell script has "hard-coded" paths in it corresponding to the input file; subprocess is used solely to invoke the shell script. I recognize this is kind of a weird setup. It's mostly here so I can delegate a chunk of functionality to be handled by a remote server queue -- just transfer the shell script over (as well as the input files), then run a queue-submit program with the shell script as the argument. I can't do that kind of thing just with subprocess. The shell script approach also makes some aspects of debugging more straightforward, but that's not why it's here. > -- > Ned Deily, > nad at acm.org > > -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan at rosspixelworks.com Fri Jan 7 16:12:59 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Fri, 7 Jan 2011 09:12:59 -0600 Subject: [Pythonmac-SIG] Py2app/Python 3.1 error Message-ID: <1e0720b8be5c7fe4e7b8bf946bf10ae0.squirrel@server3.fusednetwork.com> Has anyone seen this before? Traceback (most recent call last): File "setup.py", line 18, in setup_requires=['py2app'], File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/distutils/core.py", line 110, in setup _setup_distribution = dist = klass(attrs) File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/setuptools/dist.py", line 225, in __init__ _Distribution.__init__(self,attrs) File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/distutils/dist.py", line 263, in __init__ self.finalize_options() File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/setuptools/dist.py", line 258, in finalize_options ep.load()(self, ep.name, value) File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/pkg_resources.py", line 1954, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/Users/danr/.local/lib/python3.1/site-packages/py2app/build_app.py", line 28, in from modulegraph.find_modules import find_modules, parse_mf_results File "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/find_modules.py", line 21, in from . import modulegraph File "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/modulegraph.py", line 31, in from . import util File "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/util.py", line 69, in cookie_re = re.compile(B("coding[:=]\s*([-\w.]+)")) File "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/compat.py", line 12, in B return value.decode('latin1') AttributeError: 'str' object has no attribute 'decode' It's a simple little app using tkinter. I'm using ActiveState's Python 3.1 if that makes a difference. Thanks, Dan From aahz at pythoncraft.com Fri Jan 7 19:03:08 2011 From: aahz at pythoncraft.com (Aahz) Date: Fri, 7 Jan 2011 10:03:08 -0800 Subject: [Pythonmac-SIG] Py2app/Python 3.1 error In-Reply-To: <1e0720b8be5c7fe4e7b8bf946bf10ae0.squirrel@server3.fusednetwork.com> References: <1e0720b8be5c7fe4e7b8bf946bf10ae0.squirrel@server3.fusednetwork.com> Message-ID: <20110107180307.GA18089@panix.com> On Fri, Jan 07, 2011, Dan Ross wrote: > > Has anyone seen this before? No, but I can provide a clue... > File > "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/compat.py", > line 12, in B > return value.decode('latin1') > AttributeError: 'str' object has no attribute 'decode' > > It's a simple little app using tkinter. Python 3.1 strings don't have a decode method, so this is almost certainly legacy code from Python 2.x that's trying to get from string to unicode instead of going from bytes to string. Python 3.1.2 (r312:79147, Mar 29 2010, 18:34:41) >>> ''.decode Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute 'decode' >>> b''.decode Any particular reason you're using 3.1 instead of 2.7? -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Think of it as evolution in action." --Tony Rand From dan at rosspixelworks.com Sat Jan 8 15:38:21 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Sat, 8 Jan 2011 08:38:21 -0600 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 93, Issue 5 In-Reply-To: References: Message-ID: <6D58652F-1A3A-46D1-9676-CD2E81F9F53D@rosspixelworks.com> Hey Aahz- Just thought I'd try porting a little utility from 2.7 to 3.1 for kicks. On Jan 8, 2011, at 5:00 AM, pythonmac-sig-request at python.org wrote: > Send Pythonmac-SIG mailing list submissions to > pythonmac-sig at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/pythonmac-sig > or, via email, send a message with subject or body 'help' to > pythonmac-sig-request at python.org > > You can reach the person managing the list at > pythonmac-sig-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Pythonmac-SIG digest..." > Today's Topics: > > 1. Py2app/Python 3.1 error (Dan Ross) > 2. Re: Py2app/Python 3.1 error (Aahz) > > From: "Dan Ross" > Date: January 7, 2011 9:12:59 AM CST > To: "Pythonmac-sig" > Subject: [Pythonmac-SIG] Py2app/Python 3.1 error > Reply-To: dan at rosspixelworks.com > > > Has anyone seen this before? > > Traceback (most recent call last): > File "setup.py", line 18, in > setup_requires=['py2app'], > File > "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/distutils/core.py", > line 110, in setup > _setup_distribution = dist = klass(attrs) > File > "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/setuptools/dist.py", > > line 225, in __init__ > _Distribution.__init__(self,attrs) > File > "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/distutils/dist.py", > line 263, in __init__ > self.finalize_options() > File > "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/setuptools/dist.py", > > line 258, in finalize_options > ep.load()(self, ep.name, value) > File > "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/pkg_resources.py", > > line 1954, in load > entry = __import__(self.module_name, globals(),globals(), > ['__name__']) > File > "/Users/danr/.local/lib/python3.1/site-packages/py2app/build_app.py", > line 28, in > from modulegraph.find_modules import find_modules, parse_mf_results > File > "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/find_modules.py", > line 21, in > from . import modulegraph > File > "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/modulegraph.py", > line 31, in > from . import util > File > "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/util.py", > line 69, in > cookie_re = re.compile(B("coding[:=]\s*([-\w.]+)")) > File > "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/compat.py", > line 12, in B > return value.decode('latin1') > AttributeError: 'str' object has no attribute 'decode' > > It's a simple little app using tkinter. > > I'm using ActiveState's Python 3.1 if that makes a difference. > > Thanks, > > Dan > > > > > > > > From: Aahz > Date: January 7, 2011 12:03:08 PM CST > To: Pythonmac-sig > Subject: Re: [Pythonmac-SIG] Py2app/Python 3.1 error > > > On Fri, Jan 07, 2011, Dan Ross wrote: >> >> Has anyone seen this before? > > No, but I can provide a clue... > >> File >> "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/compat.py", >> line 12, in B >> return value.decode('latin1') >> AttributeError: 'str' object has no attribute 'decode' >> >> It's a simple little app using tkinter. > > Python 3.1 strings don't have a decode method, so this is almost > certainly legacy code from Python 2.x that's trying to get from string to > unicode instead of going from bytes to string. > > Python 3.1.2 (r312:79147, Mar 29 2010, 18:34:41) >>>> ''.decode > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'str' object has no attribute 'decode' >>>> b''.decode > > > Any particular reason you're using 3.1 instead of 2.7? > -- > Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ > > "Think of it as evolution in action." --Tony Rand > > > > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From hengist.podd at virgin.net Sun Jan 9 19:49:10 2011 From: hengist.podd at virgin.net (has) Date: Sun, 09 Jan 2011 18:49:10 +0000 Subject: [Pythonmac-SIG] last call for any py-appscript issues Message-ID: <4D2A0326.5080400@virgin.net> Hi all, Just to say that I plan to release py-appscript 1.0.0 final this month, so if you've noticed any bugs, inaccuracies, typos, stuff that doesn't quite make sense, etc. then please report it ASAP. Also, new bug-fix releases of ASDictionary 0.13.1 and ASTranslate 0.5.1 are now available that correct OS X 10.4 compatibility problems introduced in the previous releases. (Many thanks to Karsten Wolf for his assistance in fixing these.) Thanks, has From njriley at illinois.edu Mon Jan 10 00:17:17 2011 From: njriley at illinois.edu (Nicholas Riley) Date: Sun, 9 Jan 2011 17:17:17 -0600 Subject: [Pythonmac-SIG] py2app looking for ae.so in the wrong place In-Reply-To: <20110104032709.GA1255@illinois.edu> References: <20110104032709.GA1255@illinois.edu> Message-ID: <20110109231717.GB24380@illinois.edu> On Mon, Jan 03, 2011 at 09:27:09PM -0600, Nicholas Riley wrote: > I finally upgraded my iMac from 10.5 to 10.6 and tried to recompile > one of my py2app apps with the system Python 2.6.1 and current py2app. > > The application uses appscript, but for some reason it's trying to > import ae.so from /System: [...] For anyone else who runs into a similar problem - I didn't get any responses on this so I just uninstalled the current py2app and went back to the 10.6-bundled version, which worked fine. -- Nicholas Riley From parkjv1 at gmail.com Thu Jan 13 03:43:37 2011 From: parkjv1 at gmail.com (John Parker) Date: Wed, 12 Jan 2011 16:43:37 -1000 Subject: [Pythonmac-SIG] Loading Python on my Mac Message-ID: Hello, I'm totally new to Python and having worked in a windows environment for years and now my personal pc of choice is a mac. Would someone be so kind as to walk me through installing python on a mac? I don't want to use the newest version because the class that I'm trying to get into uses 2.6 and 2.7 versions only. So, I need that version installed so I can do homework assignments, etc. Many thanks, John From skip at pobox.com Thu Jan 13 04:06:50 2011 From: skip at pobox.com (skip at pobox.com) Date: Wed, 12 Jan 2011 21:06:50 -0600 Subject: [Pythonmac-SIG] Loading Python on my Mac In-Reply-To: References: Message-ID: <19758.27722.964319.874775@montanaro.dyndns.org> John> I'm totally new to Python and having worked in a windows John> environment for years and now my personal pc of choice is a mac. John> Would someone be so kind as to walk me through installing python John> on a mac? John> I don't want to use the newest version because the class that I'm John> trying to get into uses 2.6 and 2.7 versions only. So, I need John> that version installed so I can do homework assignments, etc. Have you tried /usr/bin/python? On Leopard (10.5.x) it is v 2.5.1. If you have Snow Leopard perhaps it's 2.6.something. If that won't work for your needs, just download the Mac installer image for 2.7.1 appropriate to your version of OS X from this page: http://python.org/download/releases/2.7.1/ Once installed, locate the file (probably in ~/Downloads or something similar) and double-click it to install in the usual manner. I normally just build from source (and don't bother with the framework stuff), so just to confirm my instructions, I tried it out: * download * open the disk image (double click, use the "open" command from a shell prompt, etc) * open the corresponding volume which that mounts (named "Python 2.7.1") * double-click the Python.mpkg file to run the installer The resulting binary is in /usr/local/bin/python (non-framework version) /usr/local/bin/pythonw (framework version) I'm sure others more knowledgeable about Python-on-a-Mac will correct any mistakes I've made. -- Skip Montanaro - skip at pobox.com - http://www.smontanaro.net/ From Chris.Barker at noaa.gov Thu Jan 13 04:15:43 2011 From: Chris.Barker at noaa.gov (Chris Barker) Date: Wed, 12 Jan 2011 19:15:43 -0800 Subject: [Pythonmac-SIG] Loading Python on my Mac In-Reply-To: <19758.27722.964319.874775@montanaro.dyndns.org> References: <19758.27722.964319.874775@montanaro.dyndns.org> Message-ID: <4D2E6E5F.6010004@noaa.gov> On 1/12/2011 7:06 PM, skip at pobox.com wrote: > The resulting binary is in > > /usr/local/bin/python (non-framework version) > /usr/local/bin/pythonw (framework version) > > I'm sure others more knowledgeable about Python-on-a-Mac will correct any > mistakes I've made. That all looks right. Note also that the installer should have added it to your PATH, so if you type: python at a command prompt, you should get it. Using the Python.org binary is a good idea, as you get an up to date version, can re-distribute binaries (via py2exe) if you want, and most third party packages provide binaries for it (of at all). good luck! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From janssen at parc.com Thu Jan 13 06:30:00 2011 From: janssen at parc.com (Bill Janssen) Date: Wed, 12 Jan 2011 21:30:00 PST Subject: [Pythonmac-SIG] Loading Python on my Mac In-Reply-To: References: Message-ID: <28480.1294896600@parc.com> Macs come with Python pre-installed. Open a Terminal window and type "python" at the prompt. Bill From cweisiger at msg.ucsf.edu Thu Jan 13 17:14:11 2011 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Thu, 13 Jan 2011 08:14:11 -0800 Subject: [Pythonmac-SIG] Loading Python on my Mac In-Reply-To: <28480.1294896600@parc.com> References: <28480.1294896600@parc.com> Message-ID: To add some clarification to what everyone's already said: OSX comes with a Python install by default, but it's not the latest and greatest. You can make a secondary install using the disk image from python.org; this will install alongside the standard Python install, so both are available. Once you have installed a new python, you can go to the commandline and type "which python". This will tell you the path to the Python executable you are currently using whenever you type "python" on the commandline. If it isn't the python you want, you can do "which -a python" to get a list of all of your options. For example: % which python /usr/bin/python % which -a python /usr/bin/python /usr/local/bin/python This says that by default I will run the python in /usr/bin (which is the default installed Python in OSX), but that there is another python in /usr/local/bin which I can also run (which is the one that I installed myself). Good luck with your class! -Chris On Wed, Jan 12, 2011 at 9:30 PM, Bill Janssen wrote: > Macs come with Python pre-installed. Open a Terminal window and type > "python" at the prompt. > > Bill > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alejandro at ti.com Tue Jan 11 18:42:34 2011 From: alejandro at ti.com (Mier, Alejandro) Date: Tue, 11 Jan 2011 11:42:34 -0600 Subject: [Pythonmac-SIG] Installing modules with py2app Message-ID: <981D0B4C9708CF41995970A0FD9B5DF2026C31935D@dlee06.ent.ti.com> Hello I have a script that installs Python, and then installs some modules with: subprocess.call("python setup.py install") The script works on Windows with py2exe, but gives me this error when using py2app: File setup.py from distutils.core import setup ImportError: No module named distutils.core I tried explicitly including distutils when building the .app bundle, with python setup.py py2app --packages distutils (and several variations of --includes), but then I get this error: error: invalid command 'install' What do I need to do to make this work on mac? Thanks! From cappy2112 at gmail.com Mon Jan 17 04:18:04 2011 From: cappy2112 at gmail.com (Tony Cappellini) Date: Sun, 16 Jan 2011 19:18:04 -0800 Subject: [Pythonmac-SIG] Python development on OSX Message-ID: Hello everyone, I've been doing Python development on Windows for several years, and now I will also be trying this on OSX. After getting my Macbook Pro, I've updated the os/software, then tried updating to Python 2.7. No knowing there are so many places to get the core Python installer for OSX, a friend had suggested that I install the Macports installer for 2.7 That installed fine, and I ran the command line that put that as the default Python to execute. I also use wxPython and want to continue developing wx apps on the Mac. When I tried running the installer for wx, a message was displayed indicating the postflight script had problems (I do have some info about the specifics of that problem somewhere, but it's not handy at the moment). So-my initial questions are... 1. Why are there so many "variations" of the Python installer for the Mac? (I'm not referring to 32-bit vs 64-bit architectures, although that does complicate things quite a bit). For example, there is the OSX installer at Python.org, then there are the Macports python variations, and I recently read about something called Macpython. How does one know which o to use? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From cappy2112 at gmail.com Mon Jan 17 04:58:35 2011 From: cappy2112 at gmail.com (Tony Cappellini) Date: Sun, 16 Jan 2011 19:58:35 -0800 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: References: Message-ID: Thanks Dan Fink? Which one is that? On Sun, Jan 16, 2011 at 7:30 PM, Daniel O'Donovan wrote: > Hi Tony, > > > 1. Why are there so many "variations" of the Python installer for the > Mac? > > > I think you'll find that the biggest difference between MacPorts python > (and fink python) and most other builds (python.org for example), is that > MacPorts uses X11 rather than Aqua (Apple's native window manager) and are > not built as Apple 'Frameworks' - but rather regular shared libraries (more > like with linux). > > Using fink and MacPorts help integration with many linux type apps > (particularly helpful for scientific programming) whilst the native, > Framework builds are better for native looking Macintosh apps - and the > Apple bundled python is obviously native. > > This is a simple summary, and there are 101 more differences between all > the builds - but I think the first decision you'll want to make is whether > to go the Linux route, or go 'native' ;-) > > hth, > > Dan > > Daniel O'Donovan > dan.odonovan at gmail.com > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cappy2112 at gmail.com Mon Jan 17 05:02:58 2011 From: cappy2112 at gmail.com (Tony Cappellini) Date: Sun, 16 Jan 2011 20:02:58 -0800 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: References: Message-ID: >>Using fink and MacPorts help integration with many linux type apps > (particularly helpful for scientific programming) whilst the native, > Framework builds are better >>for native looking Macintosh apps - and the > Apple bundled python is obviously native. > > >>This is a simple summary, and there are 101 more differences between all > the builds - but I think the first decision you'll want to make is whether > to go the Linux >>route, or go 'native' ;-) > Since I don't have any other specific needs at the moment other than developing wxPython apps, I think I'd better go native, since wx attempts to make the widgets look native. Well, that's a good start, but I probably need to uninstall Macports, so I can get wxPython installed to a working state. And- I want to update the default python that came om my macbook pro to 2.7. Should I do install that from Python.org? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Mon Jan 17 08:38:58 2011 From: nad at acm.org (Ned Deily) Date: Sun, 16 Jan 2011 23:38:58 -0800 Subject: [Pythonmac-SIG] Python development on OSX References: Message-ID: In article , Tony Cappellini wrote: > On Sun, Jan 16, 2011 at 7:30 PM, Daniel O'Donovan > wrote: > > I think you'll find that the biggest difference between MacPorts python > > (and fink python) and most other builds (python.org for example), is that > > MacPorts uses X11 rather than Aqua (Apple's native window manager) and are > > not built as Apple 'Frameworks' - but rather regular shared libraries (more > > like with linux). Actually, while Fink uses a Unix-style shared library build, most other distributors including MacPorts, the Apple-supplied Pythons in OS X, and the ActiveState Pythons, use an OS X framework build based on the python.org builds. The Tk on MacPorts is built as an X11 version by default but there is an Aqua port variant at well. Unfortunately, the Aqua variant is broken on OS X 10.6 but there is hope that it will get unbroken now that ActiveState has started packaging a reliable version of the patched Cocoa-based Tk 8.5 which works in both 32- and 64-bit modes. -- Ned Deily, nad at acm.org From nad at acm.org Mon Jan 17 08:43:30 2011 From: nad at acm.org (Ned Deily) Date: Sun, 16 Jan 2011 23:43:30 -0800 Subject: [Pythonmac-SIG] Python development on OSX References: Message-ID: In article , > 1. Why are there so many "variations" of the Python installer for the > Mac? (I'm not referring to 32-bit vs 64-bit architectures, although that > does complicate things quite a bit). > > For example, there is the OSX installer at Python.org, then there are the > Macports python variations, and I recently read about something called > Macpython. > > How does one know which o to use? You left out a few! ?Why are there so many? ?History, varying needs, release schedules, because it's a fun thing to do - those are some of the reasons. Here is my take on it. Since at least Mac OS X 10.3 (7+ years ago), Apple has been including one or more versions of Python as part of OS X and over the years they've added more and more third-party Python packages and a few of their own Python add-ons. ?For many people's needs, the Apple versions are sufficient. ?On the other hand, like many operating system distributors, Apple tends to be very conservative about which versions it includes in major OS X releases, which tend to come out every two years or so, and they usually only supply security and some bug fixes in between major releases. For example, the current OS X release, 10.6.6, has Python 2.6.1 (released 2008-12) and 2.5.4 built in. ?At the moment, Python 2.7.1 and Python 3.1.3 are current. ?So, people looking for the latest and greatest Python releases usually have to look elsewhere. Back in the old days prior to Mac OS X, there was a project to make Python available on its predecessor, Mac OS 9 (and earlier). ?That was known as MacPython and, in the early releases of Mac OS X, it continued to make releases for OS X. ?At some point, the MacPython project was merged into the standard Python Software Foundation (PSF or python.org) development and release process and installers for OS X begin being supplied as part of "official" releases of Python, rather than from a separate MacPython project. ?That's where we are today although there are still vestigial references to MacPython online. One of the interesting characteristics of Mac OS X is that it combines technology from different origins and so it presents different faces to different kinds of users. ?A lot of stuff comes from its NeXT operating system heritage, a somewhat non-traditional Unix. ?When Apple decided to use it as the basis for Mac OS X, features were added to make the transition easier for users of traditional Mac OS. ?And more and more vanilla open-source products and features from modern Unix-y systems (like the BSDs and Linux) were incorporated. ?That shows up in Python in a few ways, including two rather different ways of installing Python on OS X: a traditional shared library approach as is used on nearly all other Unix-style systems, and a unique-to-OSX "framework" install which is based on NeXT practices. ?Most distributors of OS X Pythons use the latter but not all. Another feature of OS X, rarely seen elsewhere, is the ability to have executable code for multiple architectures "glued" together into one file, a so-called universal file. ?That allows Apple to distribute one set of executable files and libraries that can support current and previous architectures. That was used to ease the big transition from PPC to Intel CPUs and, more recently, from 32-bit Intel to 64-bit Intel. It allows for a lot of flexibility and backwards compatibility but at the cost of added complexity for third-party languages like Python. ?So some of the reasons for different Python installers have been because of what architectures are supported and differing approaches to backwards compatibility (like how many OS X releases to support with one version). Another reason: while Apple supplies a lot of open source software as part of OS X, it doesn't supply everything. ?One common reason is because of licensing issues (avoiding GPL libraries, for example). Also, Apple does not supply a package manager for its software, like those developed over the years for other open source systems. ?There have been at least three projects that have evolved to address that: Fink which provides many of the Debian/Ubuntu packages for OS X (without the Linux kernel of course); MacPorts (previously known as DarwinPorts) which provides the FreeBSD package ports; and, more recently, HomeBrew which has its own way of managing packages. ?All three provide Python ports and the associated infrastructure. ?And that can be very useful on Mac OS X when you want to install and run Python packages that depend on third-party libraries not included with OS X. ?Classic examples of those are the Python Imaging Library (PIL) and MySQLdb. ?Both require libs not included in OS X. You can build everything yourself but, for everything to work, you need to make sure that all the pieces are compatible, that is, built with compatible archs and deployment targets. ?A good package manager, like MacPorts or Fink, will eliminate the guess work and automatically build and install all the required dependencies in a compatible way so that it should all just work. ?That's probably the biggest reason for the popularity of installing Python from one of those distributors: it can be a huge time saver. On the other hand, it is very difficult for volunteer-staffed projects, like most of these are, to keep on top of every package and keep them all up-to-date with optimal configuration selections. ?That's one of the reasons for commercial distributions, like ActiveState Python and the Enthought Python distribution, both of which build off of python.org configurations but add their own packages and offer paid support options on top of things. ?They also may target specific communities: EPD caters to the scientific / numeric user community. Another complicating factor has been the way third-party Python packages have been made available. ?Over the past ten years are so, there have been a number of key improvements and growing standardization in Python packaging, first with Distutils and then later easy_install (setuptools) and now Distribute, Pip, and buildout to name a few. ?Not so long ago, it was much more difficult for users to install more complex packages especially those with C extension modules and so some projects distributed their own binary installers for various platforms including dependent libraries, like you've seen with wxPython. ?These days it is a lot easier to automatically build and install Python packages, however the problems associated with dependent libraries often remain (which is a strength of the MacPorts or Fink comprehensive solution approach). So, all in all, there are lots of reasons plus others I'm forgetting. Many of them are not unique to the Mac world. ?But that doesn't make things less daunting when you first dive in. -- Ned Deily, nad at acm.org From nad at acm.org Mon Jan 17 09:28:39 2011 From: nad at acm.org (Ned Deily) Date: Mon, 17 Jan 2011 00:28:39 -0800 Subject: [Pythonmac-SIG] Python 3.2rc1 available: new 10.6 IDLE and tkinter options References: <4D329F55.9040903__48319.5588960827$1295195369$gmane$org@python.org> Message-ID: The first release candidate of Python 3.2 is now available. As with Python 2.7.1, two variants of Mac OS X installers are available for this release: the traditional 32-bit-only installer that works on all machines supported by Mac OS X 10.3.9 through current 10.6.x ; and a new 64-bit/32-bit installer for OS X 10.6.x systems. Besides the operating system versions supported, one big difference between the two is in the versions of Tcl/Tk supported by IDLE and any other programs that use tkinter, the Tk GUI toolkit included in the Python standard library. As in previous releases, the 32-bit-only installer will use the Apple-supplied TK 8.4 available in OS X 10.4, 10.4, and 10.6, or, if installed, will use ActiveState Tk 8.4 (part of ActiveTcl). Up until recently including at 2.7.1 release, the only standard available 64-bit-capable Aqua Tk version was the Cocoa Aqua 8.5 version shipped by Apple in OS X 10.6; however that has proven to be problematic when used with IDLE and other tkinter apps. Recently, ActiveState has made available a newer version of Cocoa Aqua Tk (as of this writing, 8.5.9) which seems to have solved nearly all of the IDLE problems that have been reported when using Apple Tk 8.5. The Python 3.2rc1 64-/32-bit installer is the first python.org installer that supports using the new ActiveState 8.5. It will still fall back to the Apple version but IDLE will issue a warning in that case. Which variant should you use? For 10.5 and earlier, you can only use the 32-bit version. If you are on 10.6 and want the simplest out-of-the-box experience, you may want to stick with the traditional 32-bit-only installer. Also, if you need to build applications (for example, with py2app) that need to also run on older OS X systems, you should use this version. If you really do need 64-capabilities or if you would like to try out the improved GUI capabilities in Tk 8.5 and are willing and able to install the ActiveState Tcl/Tk 8.5, then you should consider installing the new variant. If you need to use IDLE or tkinter but cannot install the ActiveState Tk 8.5, you should not use the 64-/32-bit variant with 10.6 at this time (10.6.6). In either case, your testing and feedback is needed! Please try out either or both versions and report any issues as soon as possible to the python bug tracker, http://bugs.python.org, as the final release of 3.2 is less than a month away. http://www.python.org/download/releases/3.2/ Also, along with the release is a new web page attempt at consolidating information about supported Python, Mac OS X, and Tcl/Tk releases. It will be evolving up to and beyond the release. Your comments (via the bug tracker) on it are also encouraged. http://www.python.org/download/mac/tcltk/ Thanks! In article <4D329F55.9040903__48319.5588960827$1295195369$gmane$org at python.org>, Georg Brandl wrote: > On behalf of the Python development team, I'm very happy to announce the > first release candidate of Python 3.2. > > Python 3.2 is a continuation of the efforts to improve and stabilize the > Python 3.x line. Since the final release of Python 2.7, the 2.x line > will only receive bugfixes, and new features are developed for 3.x only. > > Since PEP 3003, the Moratorium on Language Changes, is in effect, there > are no changes in Python's syntax and built-in types in Python 3.2. > Development efforts concentrated on the standard library and support for > porting code to Python 3. Highlights are: > > * numerous improvements to the unittest module > * PEP 3147, support for .pyc repository directories > * PEP 3149, support for version tagged dynamic libraries > * PEP 3148, a new futures library for concurrent programming > * PEP 384, a stable ABI for extension modules > * PEP 391, dictionary-based logging configuration > * an overhauled GIL implementation that reduces contention > * an extended email package that handles bytes messages > * a much improved ssl module with support for SSL contexts and certificate > hostname matching > * a sysconfig module to access configuration information > * additions to the shutil module, among them archive file support > * many enhancements to configparser, among them mapping protocol support > * improvements to pdb, the Python debugger > * countless fixes regarding bytes/string issues; among them full support > for a bytes environment (filenames, environment variables) > * many consistency and behavior fixes for numeric operations > > For a more extensive list of changes in 3.2, see > > http://docs.python.org/3.2/whatsnew/3.2.html > > To download Python 3.2 visit: > > http://www.python.org/download/releases/3.2/ > > Please consider trying Python 3.2 with your code and reporting any bugs > you may notice to: > > http://bugs.python.org/ > > > Enjoy! > > - -- > Georg Brandl, Release Manager > georg at python.org > (on behalf of the entire python-dev team and 3.2's contributors) -- Ned Deily, nad at acm.org From dan.odonovan at gmail.com Mon Jan 17 04:30:33 2011 From: dan.odonovan at gmail.com (Daniel O'Donovan) Date: Sun, 16 Jan 2011 22:30:33 -0500 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: References: Message-ID: Hi Tony, > 1. Why are there so many "variations" of the Python installer for the Mac? I think you'll find that the biggest difference between MacPorts python (and fink python) and most other builds (python.org for example), is that MacPorts uses X11 rather than Aqua (Apple's native window manager) and are not built as Apple 'Frameworks' - but rather regular shared libraries (more like with linux). Using fink and MacPorts help integration with many linux type apps (particularly helpful for scientific programming) whilst the native, Framework builds are better for native looking Macintosh apps - and the Apple bundled python is obviously native. This is a simple summary, and there are 101 more differences between all the builds - but I think the first decision you'll want to make is whether to go the Linux route, or go 'native' ;-) hth, Dan Daniel O'Donovan dan.odonovan at gmail.com From dan.odonovan at gmail.com Mon Jan 17 05:11:45 2011 From: dan.odonovan at gmail.com (Daniel O'Donovan) Date: Sun, 16 Jan 2011 23:11:45 -0500 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: References: Message-ID: > And- I want to update the default python that came om my macbook pro to 2.7. Should I do install that from Python.org? I personally think that this would be the simplest solution - but other distributions do have their virtues and proponents. For example, Enthought takes the pain out of maintaining a good numpy / matplotlib installation and I find Activestate make building for distribution a pleasure. For now, stick with the python.org and then switching at any point is always simple - the folks here are always friendly and full of advice! Happy coding, Dan Daniel O'Donovan dan.odonovan at gmail.com From janssen at parc.com Mon Jan 17 18:17:17 2011 From: janssen at parc.com (Bill Janssen) Date: Mon, 17 Jan 2011 09:17:17 PST Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: References: Message-ID: <63066.1295284637@parc.com> Tony Cappellini wrote: > And- I want to update the default python that came om my macbook pro to 2.7. > Should I do install that from Python.org? My advice? I've never had good luck trying to "update" the default Python that comes with the Mac. I'd recommend just leaving it alone and using it, unless there's some reason you absolutely need 2.7. It is safe to build (and run) a non-Framework build of other versions of Python in various places on your Mac, but life gets complicated if you attempt to "install" it. Bill From aahz at pythoncraft.com Mon Jan 17 22:35:41 2011 From: aahz at pythoncraft.com (Aahz) Date: Mon, 17 Jan 2011 13:35:41 -0800 Subject: [Pythonmac-SIG] Python 3.2rc1 available: new 10.6 IDLE and tkinter options In-Reply-To: References: <4D329F55.9040903__48319.5588960827$1295195369$gmane$org@python.org> Message-ID: <20110117213541.GB18228@panix.com> On Mon, Jan 17, 2011, Ned Deily wrote: > > The first release candidate of Python 3.2 is now available. As with > Python 2.7.1, two variants of Mac OS X installers are available for this > release: the traditional 32-bit-only installer that works on all > machines supported by Mac OS X 10.3.9 through current 10.6.x ; and a new > 64-bit/32-bit installer for OS X 10.6.x systems. Thanks for your hard work! -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "The volume of a pizza of thickness 'a' and radius 'z' is given by pi*z*z*a" From cappy2112 at gmail.com Mon Jan 17 23:41:24 2011 From: cappy2112 at gmail.com (Tony Cappellini) Date: Mon, 17 Jan 2011 14:41:24 -0800 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: <63066.1295284637@parc.com> References: <63066.1295284637@parc.com> Message-ID: I do want 2.7 because it's a requirement at work. I want to have the same versions & packages to avoid compatibility issues. I can put Python2.7 in a different directory and leave 2.6 there but I want the 2.7 installation to be the default one. On Mon, Jan 17, 2011 at 9:17 AM, Bill Janssen wrote: > Tony Cappellini wrote: > > > And- I want to update the default python that came om my macbook pro to > 2.7. > > Should I do install that from Python.org? > > My advice? I've never had good luck trying to "update" the default > Python that comes with the Mac. I'd recommend just leaving it alone and > using it, unless there's some reason you absolutely need 2.7. > > It is safe to build (and run) a non-Framework build of other versions of > Python in various places on your Mac, but life gets complicated if you > attempt to "install" it. > > Bill > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elguavas at gmail.com Tue Jan 18 00:15:52 2011 From: elguavas at gmail.com (Stephen Gava) Date: Tue, 18 Jan 2011 10:15:52 +1100 Subject: [Pythonmac-SIG] Python 3.2rc1 available: new 10.6 IDLE and tkinter options In-Reply-To: <20110117213541.GB18228@panix.com> References: <4D329F55.9040903__48319.5588960827$1295195369$gmane$org@python.org> <20110117213541.GB18228@panix.com> Message-ID: <4D34CDA8.2010906@gmail.com> On 18/01/11 8:35 AM, Aahz wrote: > On Mon, Jan 17, 2011, Ned Deily wrote: >> >> The first release candidate of Python 3.2 is now available. As with >> Python 2.7.1, two variants of Mac OS X installers are available for this >> release: the traditional 32-bit-only installer that works on all >> machines supported by Mac OS X 10.3.9 through current 10.6.x ; and a new >> 64-bit/32-bit installer for OS X 10.6.x systems. > > Thanks for your hard work! +10 From skip at pobox.com Tue Jan 18 01:17:40 2011 From: skip at pobox.com (skip at pobox.com) Date: Mon, 17 Jan 2011 18:17:40 -0600 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: References: <63066.1295284637@parc.com> Message-ID: <19764.56356.430001.249658@montanaro.dyndns.org> Tony> I do want 2.7 because it's a requirement at work. I want to have Tony> the same versions & packages to avoid compatibility issues. Tony> I can put Python2.7 in a different directory and leave 2.6 there Tony> but I want the 2.7 installation to be the default one. Default for you or default for the system? It's easy to make it the default for you. Just make sure the installation directory appears in your PATH ahead of /usr/bin. I believe the installer does that by default. I just installed the 2.7 framework build the other day. Now it appears ahead of my other locations: % type -a python python is /Library/Frameworks/Python.framework/Versions/2.7/bin/python python is /Users/skip/local/bin/python python is /usr/local/bin/python python is /usr/bin/python You almost certainly *don't* want it to replace /usr/bin/python. That's Apple's territory. I don't know where Apple might put proprietary modules, but it's somewhere in /System/Library/Frameworks/Python.framework/Versions/2.5 (on Leopard, at least). If you were to overwrite /usr/bin/python you'd deprive any system Python apps from modules they need. In the just-installed 2.7 I mentioned above I find 103 shared object files. In the above /System/.../2.5 directory I find 213. My guess is that many of them were put there by Apple. Resist the temptation. Make it your default, not the system default. -- Skip Montanaro - skip at pobox.com - http://www.smontanaro.net/ From cweisiger at msg.ucsf.edu Tue Jan 18 17:07:52 2011 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Tue, 18 Jan 2011 08:07:52 -0800 Subject: [Pythonmac-SIG] Installing modules with py2app In-Reply-To: <981D0B4C9708CF41995970A0FD9B5DF2026C31935D@dlee06.ent.ti.com> References: <981D0B4C9708CF41995970A0FD9B5DF2026C31935D@dlee06.ent.ti.com> Message-ID: Did you build the app bundle with the Python that came with OSX, or did you install a separate Python install from python.org and use that? You have to do the latter; py2app's not allowed to include components of the operating system in the apps it generates. Windows gets around this problem by not having a standard Python install. HTH -Chris On Tue, Jan 11, 2011 at 9:42 AM, Mier, Alejandro wrote: > Hello > > I have a script that installs Python, and then installs some modules with: > > subprocess.call("python setup.py install") > > The script works on Windows with py2exe, but gives me this error when using > py2app: > > File setup.py > from distutils.core import setup > ImportError: No module named distutils.core > > I tried explicitly including distutils when building the .app bundle, with > python setup.py py2app --packages distutils (and several variations of > --includes), but then I get this error: > > error: invalid command 'install' > > What do I need to do to make this work on mac? > > Thanks! > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alejandro at ti.com Tue Jan 18 17:27:46 2011 From: alejandro at ti.com (Mier, Alejandro) Date: Tue, 18 Jan 2011 10:27:46 -0600 Subject: [Pythonmac-SIG] Installing modules with py2app In-Reply-To: References: <981D0B4C9708CF41995970A0FD9B5DF2026C31935D@dlee06.ent.ti.com> Message-ID: <981D0B4C9708CF41995970A0FD9B5DF2026C47A8CB@dlee06.ent.ti.com> Hi I am using a separate Python install (ActivePython 2.6 ), so that's not it Thanks ------------------------------ Alejandro Mier y Concha From: pythonmac-sig-bounces+alejandro=ti.com at python.org [mailto:pythonmac-sig-bounces+alejandro=ti.com at python.org] On Behalf Of Chris Weisiger Sent: Tuesday, January 18, 2011 10:08 AM Cc: pythonmac-sig at python.org Subject: Re: [Pythonmac-SIG] Installing modules with py2app Did you build the app bundle with the Python that came with OSX, or did you install a separate Python install from python.org and use that? You have to do the latter; py2app's not allowed to include components of the operating system in the apps it generates. Windows gets around this problem by not having a standard Python install. HTH -Chris On Tue, Jan 11, 2011 at 9:42 AM, Mier, Alejandro > wrote: Hello I have a script that installs Python, and then installs some modules with: subprocess.call("python setup.py install") The script works on Windows with py2exe, but gives me this error when using py2app: File setup.py from distutils.core import setup ImportError: No module named distutils.core I tried explicitly including distutils when building the .app bundle, with python setup.py py2app --packages distutils (and several variations of --includes), but then I get this error: error: invalid command 'install' What do I need to do to make this work on mac? Thanks! _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG at python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From joao.vale at ndrive.com Tue Jan 18 18:05:53 2011 From: joao.vale at ndrive.com (=?UTF-8?Q?Jo=C3=A3o_Vale?=) Date: Tue, 18 Jan 2011 17:05:53 +0000 Subject: [Pythonmac-SIG] Installing modules with py2app In-Reply-To: <981D0B4C9708CF41995970A0FD9B5DF2026C47A8CB@dlee06.ent.ti.com> References: <981D0B4C9708CF41995970A0FD9B5DF2026C31935D@dlee06.ent.ti.com> <981D0B4C9708CF41995970A0FD9B5DF2026C47A8CB@dlee06.ent.ti.com> Message-ID: Do you have distutils installed? It usually doesn't come bundled with Python. It can be installed with easy_install: easy_install distutils Cheers, Jo?o On Tue, Jan 18, 2011 at 4:27 PM, Mier, Alejandro wrote: > Hi > > > > I am using a separate Python install (ActivePython 2.6 ), so that?s not it > > > > Thanks > > > > ------------------------------ > > Alejandro Mier y Concha > > > > From: pythonmac-sig-bounces+alejandro=ti.com at python.org > [mailto:pythonmac-sig-bounces+alejandro=ti.com at python.org] On Behalf Of > Chris Weisiger > Sent: Tuesday, January 18, 2011 10:08 AM > Cc: pythonmac-sig at python.org > Subject: Re: [Pythonmac-SIG] Installing modules with py2app > > > > Did you build the app bundle with the Python that came with OSX, or did you > install a separate Python install from python.org and use that? You have to > do the latter; py2app's not allowed to include components of the operating > system in the apps it generates. Windows gets around this problem by not > having a standard Python install. > > HTH > > -Chris > > On Tue, Jan 11, 2011 at 9:42 AM, Mier, Alejandro wrote: > > Hello > > I have a script that installs Python, and then installs some modules with: > > subprocess.call("python setup.py install") > > The script works on Windows with py2exe, but gives me this error when using > py2app: > > File setup.py > ? ?from distutils.core import setup > ImportError: No module named distutils.core > > I tried explicitly including distutils when building the .app bundle, with > python setup.py py2app --packages distutils (and several variations of > --includes), but then I get this error: > > error: invalid command 'install' > > What do I need to do to make this work on mac? > > Thanks! > _______________________________________________ > Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > > > _______________________________________________ > Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > From sridhar.ratna at gmail.com Tue Jan 18 18:42:32 2011 From: sridhar.ratna at gmail.com (Sridhar Ratnakumar) Date: Tue, 18 Jan 2011 09:42:32 -0800 Subject: [Pythonmac-SIG] Installing modules with py2app In-Reply-To: <981D0B4C9708CF41995970A0FD9B5DF2026C31935D@dlee06.ent.ti.com> References: <981D0B4C9708CF41995970A0FD9B5DF2026C31935D@dlee06.ent.ti.com> Message-ID: On Tue, Jan 11, 2011 at 9:42 AM, Mier, Alejandro wrote: > Hello > > I have a script that installs Python, and then installs some modules with: > > subprocess.call("python setup.py install") > > The script works on Windows with py2exe, but gives me this error when using py2app: > > File setup.py > ? ?from distutils.core import setup > ImportError: No module named distutils.core Try debugging this issue by printing sys.path, and check if distutils/core... exists in one of them: subprocess.call('python -c "import sys; print((sys.prefix, sys.path))"') -srid From alejandro at ti.com Tue Jan 18 23:47:15 2011 From: alejandro at ti.com (Mier, Alejandro) Date: Tue, 18 Jan 2011 16:47:15 -0600 Subject: [Pythonmac-SIG] Installing modules with py2app In-Reply-To: References: <981D0B4C9708CF41995970A0FD9B5DF2026C31935D@dlee06.ent.ti.com> Message-ID: <981D0B4C9708CF41995970A0FD9B5DF2026C47ABB8@dlee06.ent.ti.com> Hi Sridhar Your suggestion to debug this problem started me in the right path. I found a workaround for the issue. First, I explicitly included distutils in my py2app bundle. With that, the error I get is: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'install' I modified the included distutils files, and managed to get this stack trace Traceback (most recent call last): File "distutils/dist.py", line 837, in get_command_class __import__ (module_name) File "distutils/command/install.py", line 21, in from site import USER_BASE cannot import name USER_BASE The site.py included in the bundle has this comment: This is stripped down and customized for use in py2app applications So apparently, py2app is removing USER_BASE and USER_SITE from site.py. I am not sure why it does that, but it is preventing the installation of modules with py2app. I worked around it by modifying the included site.py to declare USER_BASE and USER_SITE after generating the .app bundle. I think this might be a bug in py2app, but would like to know your input on this. Regards, ------------------------------ Alejandro Mier y Concha -----Original Message----- From: Sridhar Ratnakumar [mailto:sridhar.ratna at gmail.com] Sent: Tuesday, January 18, 2011 11:43 AM To: Mier, Alejandro Cc: pythonmac-sig at python.org Subject: Re: [Pythonmac-SIG] Installing modules with py2app On Tue, Jan 11, 2011 at 9:42 AM, Mier, Alejandro wrote: > Hello > > I have a script that installs Python, and then installs some modules with: > > subprocess.call("python setup.py install") > > The script works on Windows with py2exe, but gives me this error when using py2app: > > File setup.py > ? ?from distutils.core import setup > ImportError: No module named distutils.core Try debugging this issue by printing sys.path, and check if distutils/core... exists in one of them: subprocess.call('python -c "import sys; print((sys.prefix, sys.path))"') -srid From Chris.Barker at noaa.gov Tue Jan 18 23:43:47 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 18 Jan 2011 14:43:47 -0800 Subject: [Pythonmac-SIG] Installing modules with py2app In-Reply-To: References: <981D0B4C9708CF41995970A0FD9B5DF2026C31935D@dlee06.ent.ti.com> <981D0B4C9708CF41995970A0FD9B5DF2026C47A8CB@dlee06.ent.ti.com> Message-ID: <4D3617A3.5080007@noaa.gov> On 1/18/11 9:05 AM, Jo?o Vale wrote: > Do you have distutils installed? It usually doesn't come bundled with > Python. huh? Sure it does -- distutils has been standard in Python for many many years. So that's not it. Besides, if you can run it unbundled, you have the packages you need, the question is how to get them properly into the py2app bundle. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From Chris.Barker at noaa.gov Tue Jan 18 23:52:35 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 18 Jan 2011 14:52:35 -0800 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: <63066.1295284637@parc.com> References: <63066.1295284637@parc.com> Message-ID: <4D3619B3.7070908@noaa.gov> On 1/17/11 9:17 AM, Bill Janssen wrote: >> And- I want to update the default python that came om my macbook pro to 2.7. >> Should I do install that from Python.org? > > My advice? I've never had good luck trying to "update" the default > Python that comes with the Mac. Bill -- I'm really curious what issues you've had -- I haven't tried to use Apple's Python is many years (OS-X 10.2, I think) -- and it used to be painful to do so. Since then I've stuck with the Python.org versions, and had no problems (at least none that would have been solved by using Apple's Python). Here's my decision tree: 1) Do I do a bunch of unix-y command line stuff in general, and not want to develop OS-X GUIs? if yes -- use Macports if no: Do I need/want a newer version than Apple provides? if yes: python.org build Do I need/want to use py2app to distribute my app(s)? if yes: use the Python.org build Do I want to use pre-build binaries of common hard-to-build packages? if yes: use the python.org build. You can see that most roads lead to the python.org builds. That being said, to be clear: You don't "upgrade" Apple's python. Rather, you install a new one alongside it, and use that for your work. > It is safe to build (and run) a non-Framework build of other versions of > Python in various places on your Mac, but life gets complicated if you > attempt to "install" it. Again, I've never had a complication from an installed python.org build. You sure would if you put it in the same place as Apple's but the installers don't do that. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From janssen at parc.com Wed Jan 19 01:29:08 2011 From: janssen at parc.com (Bill Janssen) Date: Tue, 18 Jan 2011 16:29:08 PST Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: <4D3619B3.7070908@noaa.gov> References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> Message-ID: <8318.1295396948@parc.com> Christopher Barker wrote: > On 1/17/11 9:17 AM, Bill Janssen wrote: > >> And- I want to update the default python that came om my macbook pro to 2.7. > >> Should I do install that from Python.org? > > > > My advice? I've never had good luck trying to "update" the default > > Python that comes with the Mac. > > Bill -- I'm really curious what issues you've had -- I haven't tried > to use Apple's Python is many years (OS-X 10.2, I think) -- and it > used to be painful to do so. Since then I've stuck with the Python.org > versions, and had no problems (at least none that would have been > solved by using Apple's Python). In general, there are issues around site-packages, paths, and other such things. I don't think you and I necessarily have much trouble with it, but I tend to help others with Python on Macs, and they seem to get into all kinds of trouble. The best one I've found is one group who had decided to upgrade their Leopard Python to 2.6. They'd installed the python.org Python, removed the symlink /usr/bin/python, and re-linked /usr/bin/python to the 2.6 version. They were happy, but plagued by odd problems with their machines that didn't (to them) seem to be Python-related. Another problem I've run into more than once was that the user had installed different incompatible versions of an extension, and couldn't see why an application (with an embedded Python interpreter) was misbehaving -- it was getting the wrong version of the extension. Not sure this is much use to anyone, but here's my decision tree, which has worked well for me over the past 7 years: > 1) Do I do a bunch of unix-y command line stuff in general, and not > want to develop OS-X GUIs? if yes -- use system Python. if no: > Do I need/want a newer version than Apple provides? if yes: build non-framework version from source. > Do I need/want to use py2app to distribute my app(s)? Never happens. Do I want to use pre-build binaries of common hard-to-build packages? if yes: cry about the general unfairness of the world, then build them from source instead to work with the system Python. Bill From Chris.Barker at noaa.gov Wed Jan 19 01:02:09 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 18 Jan 2011 16:02:09 -0800 Subject: [Pythonmac-SIG] Installing modules with py2app In-Reply-To: <981D0B4C9708CF41995970A0FD9B5DF2026C47ABB8@dlee06.ent.ti.com> References: <981D0B4C9708CF41995970A0FD9B5DF2026C31935D@dlee06.ent.ti.com> <981D0B4C9708CF41995970A0FD9B5DF2026C47ABB8@dlee06.ent.ti.com> Message-ID: <4D362A01.1080706@noaa.gov> On 1/18/11 2:47 PM, Mier, Alejandro wrote: > I modified the included distutils files, and managed to get this stack trace > > Traceback (most recent call last): > File "distutils/dist.py", line 837, in get_command_class > __import__ (module_name) > File "distutils/command/install.py", line 21, in > from site import USER_BASE > cannot import name USER_BASE > > The site.py included in the bundle has this comment: This is stripped down and customized for use in py2app applications > > So apparently, py2app is removing USER_BASE and USER_SITE from site.py. I am not sure why it does that, but it is preventing the installation of modules with py2app. > > I worked around it by modifying the included site.py to declare USER_BASE and USER_SITE after generating the .app bundle. > > I think this might be a bug in py2app, but would like to know your input on this. I don't think it's a bug -- you may have some problems with this. I'm not sure I quite get what distutils is doing with USER_BASE and USER_SITE, but I suspect that they are using them to figure out where to install stuff. That should be a function of the python you are installing to. A py2app bundle isn't usually installing stuff into itself. How are you using distutils in this case? Are you installing stuff into the app bundle? Or into a system python? If a system python, you should probably use the system python's distutils (and thus its site.py) to do the work. If you are installing into the app bundle (cool idea!), then you'll need to make sure that USER_BASE and USER_SITE are set correctly at run time for where the user happens to have put the py2app bundle. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From a.h.jaffe at gmail.com Wed Jan 19 13:38:41 2011 From: a.h.jaffe at gmail.com (Andrew Jaffe) Date: Wed, 19 Jan 2011 12:38:41 +0000 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: References: <63066.1295284637@parc.com> Message-ID: On 17/01/2011 22:41, Tony Cappellini wrote: > I do want 2.7 because it's a requirement at work. > I want to have the same versions & packages to avoid compatibility issues. > > I can put Python2.7 in a different directory and leave 2.6 there but I > want the 2.7 installation > to be the default one. > For the purposes you actually mean, the python.org install does become the default one -- you can install it so that it comes earlier on your path (and I believe even this step is automated). In this case, all packages installed at the command line (or by binary installers) are in place for this build. I have not found an advantage to the fink or macports installs in the last few versions of Python versions. But it's crucial to leave the Apple-installed build exactly where it is, as it is used by the system. Andrew From Chris.Barker at noaa.gov Wed Jan 19 20:10:17 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 19 Jan 2011 11:10:17 -0800 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: <8318.1295396948@parc.com> References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> Message-ID: <4D373719.3030307@noaa.gov> NOTE: I'm not trying to persuade Bill of anything -- he's clearly found a method that works well for him, but for future googlers, I think a few clarifications are in order: On 1/18/11 4:29 PM, Bill Janssen wrote: >> Bill -- I'm really curious what issues you've had -- > In general, there are issues around site-packages, paths, and other such > things. I don't think you and I necessarily have much trouble with it, > but I tend to help others with Python on Macs, and they seem to get into > all kinds of trouble. The best one I've found is one group who had > decided to upgrade their Leopard Python to 2.6. They'd installed the > python.org Python, removed the symlink /usr/bin/python, and re-linked > /usr/bin/python to the 2.6 version. They were happy, but plagued by odd > problems with their machines that didn't (to them) seem to be > Python-related. OK -- well, I'd say the solution to that is simple: DON'T DO THAT. We say time and time again that you should NEVER mess with Apple's python. So there problem was not that they installed another python, but that they broke Apple's. And there is no need -- they got too smart for their own good. The python.org installer changes the users PATH anyway. (granted, not for all users, but if you have a multi user system, you'll need to know how to manage PATHs anyway -- and /usr/local should be on everyone's PATH) > Another problem I've run into more than once was that the user had > installed different incompatible versions of an extension, and couldn't > see why an application (with an embedded Python interpreter) was > misbehaving -- it was getting the wrong version of the extension. Well, Even Apple supplies more than one version these days -- if you are embedding Python, you're going to need to know what you are doing. > Not sure this is much use to anyone, but here's my decision tree, which > has worked well for me over the past 7 years: > >> 1) Do I do a bunch of unix-y command line stuff in general, and not >> want to develop OS-X GUIs? > > if yes -- use system Python. well, I meant a bunch of unix-y stuff in addition to Python -- stuff that Apple doesn't give you -- I use MacPorts for a bunch of command-line scientific tools, and it would make some sense to use macports python for those things, too (dependencies and all). But yes, if you are doing command line stuff and don't need anything Apples doesn't give you -- the Apple python is fine (unless you need a newer version) > if no: > >> Do I need/want a newer version than Apple provides? > > if yes: build non-framework version from source. I can hardly see this as easier/more reliable than installing the python.org build -- if you build from source and overwrite /usr/bin/python, you'll sure get the same problems! And anyone that can build from source understand PATHs, etc, enough not to screw things up! >> Do I need/want to use py2app to distribute my app(s)? > > Never happens. fair enough. > Do I want to use pre-build binaries of common hard-to-build packages? > > if yes: cry about the general unfairness of the world, then build them > from source instead to work with the system Python. Why cry when wxPython, PIL, SciPy, Matplotlib, ??? are available as nifty easy to use installers? There really aren't very many people for whom "build it from source" is the best option. Final NOTE: It's great that Bill takes this approach -- he's gotten things working and helped others a lot -- someone's got to build from source! Thanks, Bill! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From aahz at pythoncraft.com Wed Jan 19 23:15:30 2011 From: aahz at pythoncraft.com (Aahz) Date: Wed, 19 Jan 2011 14:15:30 -0800 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: <4D373719.3030307@noaa.gov> References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> Message-ID: <20110119221530.GA1992@panix.com> On Wed, Jan 19, 2011, Christopher Barker wrote: > > OK -- well, I'd say the solution to that is simple: DON'T DO THAT. > We say time and time again that you should NEVER mess with Apple's > python. Just to repeat for emphasis: NEVER mess with ANYONE'S system python. Doesn't matter whether it's Mac, Windows (yes, some Windows machines ship with a system Python for internal utilities), or Linux. If you don't like the system Python, your Python should be installed somewhere else, with your PATH (and/or aliases) adjusted to grab it. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "The volume of a pizza of thickness 'a' and radius 'z' is given by pi*z*z*a" From cohar at conncoll.edu Thu Jan 20 06:11:42 2011 From: cohar at conncoll.edu (Charles Hartman) Date: Thu, 20 Jan 2011 00:11:42 -0500 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: <4D373719.3030307@noaa.gov> References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> Message-ID: On Wed, Jan 19, 2011 at 2:10 PM, Christopher Barker wrote: > > > Do I need/want to use py2app to distribute my app(s)? >>> >> >> Never happens. >> > > fair enough. > But this is where Bill J's use-case departs drastically from those of many users, perhaps most, and certainly the majority of those who need any help. If you think of Python as yet another handy scripting language, easier to use than Perl, etc., then you don't care about making apps -- and 60% of the questions that come to this site are irrelevant, because you're somebody who already lives inside Darwin/Unix/whatever. But there are a lot of people who do programming just in order to make user applications, not to tweak systems from half-inside. Many of them want to make cross-platform programs (which scripting geeks never do). Many of them -- me for a ready example -- know barely enough about bash to get things installed properly. More to the point: *all* of them, if they want to use Python (because they're sensible people) on the Mac (because they're sensible people) need to use py2app. Despite what's sometimes implied here, py2app is not a frill. From my point of view, it's essential to the Python community on Mac -- perhaps a minority point of view, but representing a minority that I suggest is crucial to the future of Python and the Mac. ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Charles O. Hartman Poet in Residence Professor, Chair, Department of Literatures in English oak.conncoll.edu/cohar -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Thu Jan 20 17:56:44 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 20 Jan 2011 08:56:44 -0800 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> Message-ID: <4D38694C.3000705@noaa.gov> On 1/19/11 9:11 PM, Charles Hartman wrote: > Do I need/want to use py2app to distribute my app(s)? > Never happens. > But this is where Bill J's use-case departs drastically from those of > many users, perhaps most, and certainly the majority of those who need > any help. I'm not sure about majority -- who knows, really? > Despite what's sometimes implied here, py2app is not a frill. I agree. It's a really key tool. One of the great things about Python is that it is suitable for: Quickie command line scripting Gluing larger systems together Full on application development: - web apps - command line apps - GUI apps. And on the Mac, you can: - build "native" apps with PyObjC - build cross-platform GUIs with wx or QT - build Unix-y apps with pyGTK - drive other apps with AppScript Essentially ANY kind of development short of device drivers. Is there ANY other language you can do all that with? (Ruby, maybe?) So while py2app may not be "essential to the Python community on Mac", it IS essential to a fair fraction of that community, and I think that fact that you can do all these kinds of development with the same tool strengthens its position for the other purposes as well. > and certainly the majority of those who need any help. I think that's key -- Bill's approach is fine one for some users, but not what I"d recommend to newbies that aren't sure how to set a PATH. The fact that there are a lot of ways to install Python on the Mac has really been a pain for the community to support (and pretty ironic, considering how the Mac platform usually is!). I'm not sure there is much that can be done about it, but one thing we have mostly done is try to use this list to declare the python.org builds as the "official" ones and try to get third party projects to build binaries for them If you need help with macports, ask on a macports list, etc. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From cweisiger at msg.ucsf.edu Thu Jan 20 18:10:35 2011 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Thu, 20 Jan 2011 09:10:35 -0800 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: <4D38694C.3000705@noaa.gov> References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> <4D38694C.3000705@noaa.gov> Message-ID: On Thu, Jan 20, 2011 at 8:56 AM, Christopher Barker wrote: > On 1/19/11 9:11 PM, Charles Hartman wrote: > >> Do I need/want to use py2app to distribute my app(s)? >> Never happens. >> > > But this is where Bill J's use-case departs drastically from those of >> many users, perhaps most, and certainly the majority of those who need >> any help. >> > > I'm not sure about majority -- who knows, really? > If I want to share my work with other users, and that work is not itself a library, then as I see it I have two options: distribute either as a collection of Python modules and any resource files, or as a packaged app. The former is just about strictly worse than the latter from a usability standpoint: the user has to install Python and any libraries I depend on themselves, and then they have to invoke Python on my main module to use my code (or else I have to use a shebang line that assumes they've installed Python in a particular place), which in turn may well require using the command line. In short, if you are coding for other people who are not themselves programmers and who use OSX, then you want py2app. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From janssen at parc.com Thu Jan 20 18:19:38 2011 From: janssen at parc.com (Bill Janssen) Date: Thu, 20 Jan 2011 09:19:38 PST Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: <4D38694C.3000705@noaa.gov> References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> <4D38694C.3000705@noaa.gov> Message-ID: <69949.1295543978@parc.com> Christopher Barker wrote: > > and certainly the majority of those who need any help. > > I think that's key -- Bill's approach is fine one for some users, but > not what I"d recommend to newbies that aren't sure how to set a PATH. Hmmm. My experience is that those are exactly the folks who get into trouble by using the python.org installer on their macs -- those who don't understand how PATH influences their usage experience. > The fact that there are a lot of ways to install Python on the Mac has > really been a pain for the community to support (and pretty ironic, > considering how the Mac platform usually is!). I'm not sure there is > much that can be done about it Yep. By the way, Python is more than "just another good scripting language". I build large systems with it. I do (rarely) write Mac "applications" with Python. I use Xcode and Cocoa-Python, and IMO it works great. Is that using py2app "under the covers"? This is another reason not to install a non-system Python; it sometimes screws up apps built using Xcode and Python. Bill From alejandro at ti.com Thu Jan 20 23:10:15 2011 From: alejandro at ti.com (Mier, Alejandro) Date: Thu, 20 Jan 2011 16:10:15 -0600 Subject: [Pythonmac-SIG] Installing modules with py2app In-Reply-To: <4D362A01.1080706@noaa.gov> References: <981D0B4C9708CF41995970A0FD9B5DF2026C31935D@dlee06.ent.ti.com> <981D0B4C9708CF41995970A0FD9B5DF2026C47ABB8@dlee06.ent.ti.com> <4D362A01.1080706@noaa.gov> Message-ID: <981D0B4C9708CF41995970A0FD9B5DF2026C47B64A@dlee06.ent.ti.com> Hi Chris > How are you using distutils in this case? Are you installing stuff into > the app bundle? Or into a system python? If a system python, you should > probably use the system python's distutils (and thus its site.py) to do > the work. I am trying to install modules into the system python. The problem with my solution (which I hadn't notice); is that modules are getting installed into the .app bundle instead. The problem is that, even though subprocess.call("python setup.py install") picks up the system python (sys.executable has the expected value), it still loads the modules from the site-packages.zip in the .app bundle. How can I make this new python process load the modules from system site-packages folder? Thanks ------------------------------ Alejandro Mier y Concha -----Original Message----- From: pythonmac-sig-bounces+alejandro=ti.com at python.org [mailto:pythonmac-sig-bounces+alejandro=ti.com at python.org] On Behalf Of Christopher Barker Sent: Tuesday, January 18, 2011 6:02 PM To: pythonmac-sig at python.org Subject: Re: [Pythonmac-SIG] Installing modules with py2app On 1/18/11 2:47 PM, Mier, Alejandro wrote: > I modified the included distutils files, and managed to get this stack trace > > Traceback (most recent call last): > File "distutils/dist.py", line 837, in get_command_class > __import__ (module_name) > File "distutils/command/install.py", line 21, in > from site import USER_BASE > cannot import name USER_BASE > > The site.py included in the bundle has this comment: This is stripped down and customized for use in py2app applications > > So apparently, py2app is removing USER_BASE and USER_SITE from site.py. I am not sure why it does that, but it is preventing the installation of modules with py2app. > > I worked around it by modifying the included site.py to declare USER_BASE and USER_SITE after generating the .app bundle. > > I think this might be a bug in py2app, but would like to know your input on this. I don't think it's a bug -- you may have some problems with this. I'm not sure I quite get what distutils is doing with USER_BASE and USER_SITE, but I suspect that they are using them to figure out where to install stuff. That should be a function of the python you are installing to. A py2app bundle isn't usually installing stuff into itself. How are you using distutils in this case? Are you installing stuff into the app bundle? Or into a system python? If a system python, you should probably use the system python's distutils (and thus its site.py) to do the work. If you are installing into the app bundle (cool idea!), then you'll need to make sure that USER_BASE and USER_SITE are set correctly at run time for where the user happens to have put the py2app bundle. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG at python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From db3l.net at gmail.com Thu Jan 20 23:55:41 2011 From: db3l.net at gmail.com (David Bolen) Date: Thu, 20 Jan 2011 17:55:41 -0500 Subject: [Pythonmac-SIG] Python development on OSX References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> <4D38694C.3000705@noaa.gov> Message-ID: Chris Weisiger writes: > In short, if you are coding for other people who are not themselves > programmers and who use OSX, then you want py2app. I definitely agree with this. Py2app lets my self-contained Python apps conform to the platform norm that users are expecting. In that respect it's along the lines of py2exe (plus something like InnoSetup) on Windows letting me match those user's expectations with a single binary installer (exe or msi) that they can just run. For my Mac users, they want a DMG that contains the app to drag to Applications, or the mpkg to do the installation for them. So pretty much anything I'm going to supply them is going to use py2app first, then get packaged (optionally with PackageMaker) into a DMG through hdiutil. It also has the added benefit of having absolutely no dependence on their local environment, aside from core OSX system libraries. -- David From Chris.Barker at noaa.gov Fri Jan 21 00:03:16 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 20 Jan 2011 15:03:16 -0800 Subject: [Pythonmac-SIG] Installing modules with py2app In-Reply-To: <981D0B4C9708CF41995970A0FD9B5DF2026C47B64A@dlee06.ent.ti.com> References: <981D0B4C9708CF41995970A0FD9B5DF2026C31935D@dlee06.ent.ti.com> <981D0B4C9708CF41995970A0FD9B5DF2026C47ABB8@dlee06.ent.ti.com> <4D362A01.1080706@noaa.gov> <981D0B4C9708CF41995970A0FD9B5DF2026C47B64A@dlee06.ent.ti.com> Message-ID: <4D38BF34.8090402@noaa.gov> On 1/20/11 2:10 PM, Mier, Alejandro wrote: > The problem is that, even though subprocess.call("python setup.py install") picks up the system python > (sys.executable has the expected value), it still loads the modules from the site-packages.zip in the .app bundle. I suspect that you are getting environment variables set by py2app, rather that the user's raw environment. Maybe it shouldn't be a subprocess -- what happens if you do a simple: os.system("python setup.py install") you also may need to make sure the working dir is correct: os.system("cd the/full/path/to/setup; python setup.py install) -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From rowen at uw.edu Fri Jan 21 00:20:14 2011 From: rowen at uw.edu (Russell E. Owen) Date: Thu, 20 Jan 2011 15:20:14 -0800 Subject: [Pythonmac-SIG] Python development on OSX References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> <4D38694C.3000705@noaa.gov> <69949.1295543978@parc.com> Message-ID: In article <69949.1295543978 at parc.com>, Bill Janssen wrote: > Christopher Barker wrote: > > > > and certainly the majority of those who need any help. > > > > I think that's key -- Bill's approach is fine one for some users, but > > not what I"d recommend to newbies that aren't sure how to set a PATH. > > Hmmm. My experience is that those are exactly the folks who get into > trouble by using the python.org installer on their macs -- those who > don't understand how PATH influences their usage experience. Is that experience recent? The python.org installer got smarter at some point and started putting itself on the path, eliminating the need for users to do anything to their startup configuration files. It just works, and in my experience it works well. -- Russell From amorris at mistermorris.com Fri Jan 21 01:51:14 2011 From: amorris at mistermorris.com (Adam Morris) Date: Fri, 21 Jan 2011 07:51:14 +0700 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: <69949.1295543978@parc.com> References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> <4D38694C.3000705@noaa.gov> <69949.1295543978@parc.com> Message-ID: This python development convo has been by far the most informative so far. I'm coming at this from very much a hobbyist position. I'm a teacher and I want one programming language that lets me solve my real problems. I also want the same language to be able to do native Mac stuff too, if I ever have the need. I also want it to be a mature and thriving language, something, frankly, that would be noticed on my CV. And I want all of those things to be the same programming language because I don't have time to invest in learning how to actively use others. That to me, is what Python embodies. But I'm still confused on some major points on what it offers. >By the way, Python is more than "just another good scripting >language". I build large systems with it. I do (rarely) write Mac >"applications" with Python. I use Xcode and Cocoa-Python, and >IMO it works great. Is that using py2app "under the covers"? This >is another reason not to install a non-system Python; it sometimes >screws up apps built using Xcode and Python. I'm trying really hard to unpack this. I can't use XCode and the py-objc bridge with my "installed" python 2.7 setup? (Installed isn't quite the right word, I know.) Why not? I guess it's because something is hard-coded somewhere ... I don't particularly "need" XCode but I really want to understand this. Can't tell you how much I had read this conversation back, about a year ago, when I first started learning Python. ... -Adam Morris Teacher, programmer, trying to combine the two @brainysmurf From janssen at parc.com Fri Jan 21 03:15:03 2011 From: janssen at parc.com (Bill Janssen) Date: Thu, 20 Jan 2011 18:15:03 PST Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> <4D38694C.3000705@noaa.gov> <69949.1295543978@parc.com> Message-ID: <16105.1295576103@parc.com> Adam Morris wrote: > >By the way, Python is more than "just another good scripting > >language". I build large systems with it. I do (rarely) write Mac > >"applications" with Python. I use Xcode and Cocoa-Python, and > >IMO it works great. Is that using py2app "under the covers"? This > >is another reason not to install a non-system Python; it sometimes > >screws up apps built using Xcode and Python. > > I'm trying really hard to unpack this. I tend to build command-line tools and services. But when I need to build something with a Mac UI I pull up Xcode and use the Cocoa-Python template. Works like a charm -- but I believe it depends on the system Python. By the way, if you need to do this, take a look at Hillegass' book, COCOA PROGRAMMING FOR MAC OS X. And read Will Larson's great series, starting with http://lethain.com/entry/2008/aug/22/an-epic-introduction-to-pyobjc-and-cocoa/ > I can't use XCode and the py-objc bridge with my "installed" python > 2.7 setup? (Installed isn't quite the right word, I know.) Don't know, because I always use the "system" Python for non-Python-dev coding. But I'm betting there are some dependencies in Xcode or the Xcode templates which require the system Python. > Why not? I guess it's because something is hard-coded somewhere ... Sure. But anything hard-coded can be overridden. The sources are just sitting there... > I don't particularly "need" XCode but I really want to understand this. Unless you're developing just for the Mac, I'd suggest using PyGUI or wxPython or PyGTK or some such, and build applications (small 'a') with that, instead of Cocoa. That experience will port out of the Mac to other Unices and Windows. Bill From cohar at conncoll.edu Fri Jan 21 04:53:06 2011 From: cohar at conncoll.edu (Charles Hartman) Date: Thu, 20 Jan 2011 22:53:06 -0500 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: <16105.1295576103@parc.com> References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> <4D38694C.3000705@noaa.gov> <69949.1295543978@parc.com> <16105.1295576103@parc.com> Message-ID: We shouldn't lose sight of the fact that the people we're talking about who need to build Python programs as apps -- several of whom have responded here -- don't typically want to confine those apps to the world of Macs. Python is a great language in which to build cross-platform (LOTS of platforms) programs that will look native everywhere and run without any expertise on the part of end users. Since that makes an audience at least (at a guess) 20 times as big as the Mac-only audience, and (at a guess) 200 times as big as the command-line-and-system-tools audience -- and since the future of a language does depend on the size of its user base and not only on the savvy and enthusiasm of its most expert users -- it would seem to be short-sighted for anyone interested in Python on the Mac not to support py2app as fully as possible. Charles Hartman -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Fri Jan 21 18:41:00 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 21 Jan 2011 09:41:00 -0800 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> <4D38694C.3000705@noaa.gov> <69949.1295543978@parc.com> Message-ID: <4D39C52C.8010508@noaa.gov> On 1/20/11 4:51 PM, Adam Morris wrote: > I want one programming language that lets me solve my real > problems. > That to me, is what Python embodies. yup -- it is applicable to a VERY wide range of problems. > But I'm still confused on some major points on what it offers. > I use Xcode and Cocoa-Python, and >> IMO it works great. Is that using py2app "under the covers"? This >> is another reason not to install a non-system Python; it sometimes >> screws up apps built using Xcode and Python. > > I'm trying really hard to unpack this. I can't use XCode and the > py-objc bridge with my "installed" python 2.7 setup? (Installed isn't > quite the right word, I know.) Why not? I guess it's because something > is hard-coded somewhere ... > > I don't particularly "need" XCode but I really want to understand this. You can certainly use pyObjC without XCode. I've never tried to do python development in XCode, from the little I've read here it never seemed to be well supported. Maybe someone here can tell you how to use XCode / pyObjC for app development. Note that Apple has added a couple proprietary bits to its python install, maybe XCode relies on those. I would love to hear more about what you can and can't do with XCode. Note that if XCode has a way to build a self-contained App, and it uses Apple's system python, you are going to either get something that won't work on older systems, or you are going to be using an older python. You can't re-distribute Apple's python. Also -- Apple has NEVER upgraded a python it delivered. Most of the bugs fixed between X.1 and X.5 versions of python are unlikely to bite you, but I had at least one that did -- when I found it, it had been fixed in the python.org release, but not in Apples -- and Apple has still not fixed it -- so I don't know what I'd have done if I'd be confined to Apple's python. Yes, I'm confined to Apple's OS - but at least they do update that! And Bill's right -- if you want to support other platforms, wxPython or pyQT is the way to go. (pyGTK is so non-native on the Mac I wouldn't consider it, and I don't think pyGUI is very mature yet) (the binaries for wxPython work with both the Apple and python.org builds -- 32 bit only for the moment) -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From janssen at parc.com Fri Jan 21 19:40:51 2011 From: janssen at parc.com (Bill Janssen) Date: Fri, 21 Jan 2011 10:40:51 PST Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> <4D38694C.3000705@noaa.gov> <69949.1295543978@parc.com> <16105.1295576103@parc.com> Message-ID: <24505.1295635251@parc.com> Charles Hartman wrote: > it would seem to be short-sighted for anyone interested in Python on > the Mac not to support py2app as fully as possible. You calling me short-sighted, Charles? That's OK -- it's true, you know; I've been wearing thick glasses since I was a kid :-). But I don't know that it has much to do with py2app. I think py2app is great, and I believe I even used it, once -- wanted to make a Preference Pane with Python, and couldn't figure out how to do it otherwise. But in general I've not needed it -- I just use Xcode and the system Python, and there's no need to bundle another Python with that approach. I should probably figure out how to use py2app with that approach, though; it might be more bullet-proof. Bill From cohar at conncoll.edu Fri Jan 21 22:37:19 2011 From: cohar at conncoll.edu (Charles Hartman) Date: Fri, 21 Jan 2011 16:37:19 -0500 Subject: [Pythonmac-SIG] Python development on OSX In-Reply-To: <24505.1295635251@parc.com> References: <63066.1295284637@parc.com> <4D3619B3.7070908@noaa.gov> <8318.1295396948@parc.com> <4D373719.3030307@noaa.gov> <4D38694C.3000705@noaa.gov> <69949.1295543978@parc.com> <16105.1295576103@parc.com> <24505.1295635251@parc.com> Message-ID: On Fri, Jan 21, 2011 at 1:40 PM, Bill Janssen wrote: > Charles Hartman wrote: > > > it would seem to be short-sighted for anyone interested in Python on > > the Mac not to support py2app as fully as possible. > > You calling me short-sighted, Charles? > > That's OK -- it's true, you know; I've been wearing thick glasses since > I was a kid :-). But I don't know that it has much to do with py2app. > Oh, you should see my glasses. Are you telling me py2app didn't cause this??? > I think py2app is great, and I believe I even used it, once -- wanted to > make a Preference Pane with Python, and couldn't figure out how to do it > otherwise. > > But in general I've not needed it -- I just use Xcode and the system > Python, and there's no need to bundle another Python with that approach. > I should probably figure out how to use py2app with that approach, > though; it might be more bullet-proof. > > Bill > My point was just that a lot of us can't use Python the way or you, or aren't willing or likely to. We're just application programmers, not systems programmers. And we also can't afford to code only for Mac. I write educational programs, and a lot of my (benighted) students persist in using Windows. And then, my more argumentative point was that Python needs us: we're the ones who bring the wider attention and the critical mass. Maybe I don't understand how the support of programming languages works, but I know there are beautiful languages out there orbiting lonely stars because people admired them only from afar. I'd be interested to know, if anyone knows: why DID Apple start including Python? Charles -------------- next part -------------- An HTML attachment was scrubbed... URL: From parkjv1 at gmail.com Sat Jan 22 21:56:30 2011 From: parkjv1 at gmail.com (John Parker) Date: Sat, 22 Jan 2011 10:56:30 -1000 Subject: [Pythonmac-SIG] My first Python Program In-Reply-To: <24505.1295635251@parc.com> Message-ID: Hello All, I'm a complete novice to Python and I just created my first program for an assignment in a Python class that I'm taking at the local community college. The instructor didn't give us a book so, I'm trying to figure out one important item. How to run my program. I know this is so basic for everyone but I just started this class and this is my first exposure ever to this type of environment. I have an iMac, running python V2.6.1 My program is located in this directory: File location: /Users/parkjv1/Birth_Month.py When I open the terminal: I'm presented with this info: cpe-66-75-97-27: ~parkjv1$ Is this my /users/parkjv1 directory? When I type my file name Birth_Month.py I get an error indicating that command not found. So, where do I call my program so that it will run? Thanks, John _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG at python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG On 1/21/11 8:40 AM, "Bill Janssen" wrote: > Charles Hartman wrote: > >> it would seem to be short-sighted for anyone interested in Python on >> the Mac not to support py2app as fully as possible. > > You calling me short-sighted, Charles? > > That's OK -- it's true, you know; I've been wearing thick glasses since > I was a kid :-). But I don't know that it has much to do with py2app. > I think py2app is great, and I believe I even used it, once -- wanted to > make a Preference Pane with Python, and couldn't figure out how to do it > otherwise. > > But in general I've not needed it -- I just use Xcode and the system > Python, and there's no need to bundle another Python with that approach. > I should probably figure out how to use py2app with that approach, > though; it might be more bullet-proof. > > Bill > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From massimodisasha at gmail.com Sat Jan 22 22:47:49 2011 From: massimodisasha at gmail.com (Massimo Di Stefano) Date: Sat, 22 Jan 2011 16:47:49 -0500 Subject: [Pythonmac-SIG] My first Python Program In-Reply-To: References: Message-ID: <4BA9D286-C16F-43E9-A0F6-2D3138733D41@gmail.com> Hi John, to run a python (.py) file, from the shell type : python /path/to/your/file.py (just drug'n'drop the file inside the terminal shell) to know the directory where your shell is running type the command : > pwd it will show you the path. to go inside the directory type : > cd /path/to/the/directory this [1] is a simple list of the bash commands in osx : [1] http://ss64.com/osx/ and this [2] the standard python tutorial : [2] http://docs.python.org/tutorial/ you can also try to buy a book about python that will help you to get started there are a large number of book dedicated to python programming. Il giorno 22/gen/2011, alle ore 15.56, John Parker ha scritto: > Hello All, > > I'm a complete novice to Python and I just created my first program for an > assignment in a Python class that I'm taking at the local community college. > > The instructor didn't give us a book so, I'm trying to figure out one > important item. > > How to run my program. I know this is so basic for everyone but I just > started this class and this is my first exposure ever to this type of > environment. > > I have an iMac, running python V2.6.1 > > My program is located in this directory: > > File location: /Users/parkjv1/Birth_Month.py > > When I open the terminal: > > I'm presented with this info: cpe-66-75-97-27: ~parkjv1$ > > Is this my /users/parkjv1 directory? > > When I type my file name Birth_Month.py I get an error indicating that > command not found. > > So, where do I call my program so that it will run? > > Thanks, > > John > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > > > On 1/21/11 8:40 AM, "Bill Janssen" wrote: > >> Charles Hartman wrote: >> >>> it would seem to be short-sighted for anyone interested in Python on >>> the Mac not to support py2app as fully as possible. >> >> You calling me short-sighted, Charles? >> >> That's OK -- it's true, you know; I've been wearing thick glasses since >> I was a kid :-). But I don't know that it has much to do with py2app. >> I think py2app is great, and I believe I even used it, once -- wanted to >> make a Preference Pane with Python, and couldn't figure out how to do it >> otherwise. >> >> But in general I've not needed it -- I just use Xcode and the system >> Python, and there's no need to bundle another Python with that approach. >> I should probably figure out how to use py2app with that approach, >> though; it might be more bullet-proof. >> >> Bill >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From parkjv1 at gmail.com Sat Jan 22 23:02:30 2011 From: parkjv1 at gmail.com (John Parker) Date: Sat, 22 Jan 2011 12:02:30 -1000 Subject: [Pythonmac-SIG] My first Python Program In-Reply-To: <4BA9D286-C16F-43E9-A0F6-2D3138733D41@gmail.com> Message-ID: Thanks to all for your help. I was able to successfully run my first program all be it was very simple. I have ordered a Python for Dummies book from Amazon but it hasn't arrived yet. I think that will help initially until I get familiar with this environment. Thank you all for your information and empowering me to run my program. Happy Python Programming to All!! Aloha, John On 1/22/11 11:47 AM, "Massimo Di Stefano" wrote: > Hi John, > > > to run a python (.py) file, from the shell type : > > > python /path/to/your/file.py (just drug'n'drop the file inside the terminal > shell) > > to know the directory where your shell is running type the command : > >> pwd > > it will show you the path. > > to go inside the directory type : > >> cd /path/to/the/directory > > this [1] is a simple list of the bash commands in osx : > > [1] http://ss64.com/osx/ > > and this [2] the standard python tutorial : > > [2] http://docs.python.org/tutorial/ > > you can also try to buy a book about python that will help you to get started > there are a large number of book dedicated to python programming. > > > Il giorno 22/gen/2011, alle ore 15.56, John Parker ha scritto: > >> Hello All, >> >> I'm a complete novice to Python and I just created my first program for an >> assignment in a Python class that I'm taking at the local community college. >> >> The instructor didn't give us a book so, I'm trying to figure out one >> important item. >> >> How to run my program. I know this is so basic for everyone but I just >> started this class and this is my first exposure ever to this type of >> environment. >> >> I have an iMac, running python V2.6.1 >> >> My program is located in this directory: >> >> File location: /Users/parkjv1/Birth_Month.py >> >> When I open the terminal: >> >> I'm presented with this info: cpe-66-75-97-27: ~parkjv1$ >> >> Is this my /users/parkjv1 directory? >> >> When I type my file name Birth_Month.py I get an error indicating that >> command not found. >> >> So, where do I call my program so that it will run? >> >> Thanks, >> >> John >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG >> >> >> >> On 1/21/11 8:40 AM, "Bill Janssen" wrote: >> >>> Charles Hartman wrote: >>> >>>> it would seem to be short-sighted for anyone interested in Python on >>>> the Mac not to support py2app as fully as possible. >>> >>> You calling me short-sighted, Charles? >>> >>> That's OK -- it's true, you know; I've been wearing thick glasses since >>> I was a kid :-). But I don't know that it has much to do with py2app. >>> I think py2app is great, and I believe I even used it, once -- wanted to >>> make a Preference Pane with Python, and couldn't figure out how to do it >>> otherwise. >>> >>> But in general I've not needed it -- I just use Xcode and the system >>> Python, and there's no need to bundle another Python with that approach. >>> I should probably figure out how to use py2app with that approach, >>> though; it might be more bullet-proof. >>> >>> Bill >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >>> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > From michael at possibleworlds.com Sun Jan 23 03:34:33 2011 From: michael at possibleworlds.com (michael ferraro) Date: Sat, 22 Jan 2011 21:34:33 -0500 Subject: [Pythonmac-SIG] py2app -- ouch! Message-ID: <3CDD4ED9-0E1E-4862-B1EC-8E2FEF091AF9@possibleworlds.com> Hello all and thanks for listening! I have scanned the archive and the web for current practices in packaging an Mac Python app with py2app. I have been successful before (i.e circa python 2.4 and Mac OS X 10.4). I am now working on under 10.6.6 and python 2.6.6.18 as shipped with the OS. I am using PyQt 4.8.2. as an i86_64 app. It runs fine from the terminal as python Teatro.py I used easy_install-2.6 -U py2app which retrieved and installed py2app 0.5.2. I used a couple of variation of what seem to be standard procedure to create the app including /Library/Frameworks/Python.framework/Versions/2.6/bin/py2applet --make-setup --alias --argv-emulation Teatro.py followed by: python setup.py py2app python setup.py py2app -A as well as /Library/Frameworks/Python.framework/Versions/2.6/bin/py2applet Teatro.py the setup.py file looks like this: """ This is a setup.py script generated by py2applet Usage: python setup.py py2app """ from setuptools import setup APP = ['Teatro.py'] DATA_FILES = [] OPTIONS = {'alias': True, 'argv_emulation': True} setup( app=APP, data_files=DATA_FILES, options={'py2app': OPTIONS}, setup_requires=['py2app'], ) when I try to run the app (Teatro.app or dist/Teatro depending on which procedure I used to build it) i get this: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen shot 2011-01-22 at 9.16.41 PM.png Type: image/png Size: 24572 bytes Desc: not available URL: -------------- next part -------------- The console reports: 1/22/11 8:44:43 PM com.apple.launchd.peruser.501[420] ([0x0-0x51051].org.pythonmac.unspecified.Teatro[899]) Exited with exit code: 255 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] Traceback (most recent call last): 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] File "/Users/mef/Development/-Applications-/Teatro/Teatro.app/Contents/Resources/__boot__.py", line 103, in 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] _argv_emulation() 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] File "/Users/mef/Development/-Applications-/Teatro/Teatro.app/Contents/Resources/__boot__.py", line 101, in _argv_emulation 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] _get_argvemulator().mainloop() 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] File "/Users/mef/Development/-Applications-/Teatro/Teatro.app/Contents/Resources/__boot__.py", line 40, in mainloop 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] stoptime = Evt.TickCount() + timeout 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] AttributeError: 'module' object has no attribute 'TickCount' 1/22/11 9:16:30 PM Teatro[982] Teatro Error When I build using python setup.py py2app Teatro.py without alias and argv_emulation in the setup.py /usr/bin/strip: for architecture x86_64 object: /Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/Contents/Frameworks/Python.framework/Versions/2.6/Python malformed object (load command 3 cmdsize not a multiple of 8) stripping saved 333408 bytes (8961700 / 9295108) as the last line of the build and in the build directory i get dist.macosx-10.5-intel/ but away get the same result as above when I try to run the app I am sure it is obvious what is wrong but I have reach a dead end. Any help would be appreciated Michael Ferraro Assoc. Prof. Art Dept. Lehman College CUNY Bronx, NY From michael at possibleworlds.com Sun Jan 23 18:33:00 2011 From: michael at possibleworlds.com (michael ferraro) Date: Sun, 23 Jan 2011 12:33:00 -0500 Subject: [Pythonmac-SIG] py2app -- ouch! In-Reply-To: <3CDD4ED9-0E1E-4862-B1EC-8E2FEF091AF9@possibleworlds.com> References: <3CDD4ED9-0E1E-4862-B1EC-8E2FEF091AF9@possibleworlds.com> Message-ID: <56138F5E-B319-41F3-9352-7954BE312166@possibleworlds.com> I eliminated the 1st of my problems by turning off argv_emulation. That takes care of the Evt.TickCount problem . But I am running afoul of the site-packages problem when I run the built app I will repost as an new thread for clarity m On Jan 22, 2011, at 9:34 PM, michael ferraro wrote: > Hello all and thanks for listening! > > I have scanned the archive and the web for current practices in packaging an Mac Python app with > py2app. I have been successful before (i.e circa python 2.4 and Mac OS X 10.4). I am now working > on under 10.6.6 and python 2.6.6.18 as shipped with the OS. I am using PyQt 4.8.2. as an i86_64 > app. It runs fine from the terminal as > python Teatro.py > > > I used > easy_install-2.6 -U py2app which retrieved and installed py2app 0.5.2. > > I used a couple of variation of what seem to be standard procedure to create the > app including > /Library/Frameworks/Python.framework/Versions/2.6/bin/py2applet --make-setup --alias --argv-emulation Teatro.py > > followed by: > python setup.py py2app > python setup.py py2app -A > > as well as > /Library/Frameworks/Python.framework/Versions/2.6/bin/py2applet Teatro.py > > the setup.py file looks like this: > > """ > This is a setup.py script generated by py2applet > > Usage: > python setup.py py2app > """ > > from setuptools import setup > > APP = ['Teatro.py'] > DATA_FILES = [] > OPTIONS = {'alias': True, 'argv_emulation': True} > > setup( > app=APP, > data_files=DATA_FILES, > options={'py2app': OPTIONS}, > setup_requires=['py2app'], > ) > > when I try to run the app (Teatro.app or dist/Teatro depending on which procedure I used > to build it) i get this: > > > > > The console reports: > > 1/22/11 8:44:43 PM com.apple.launchd.peruser.501[420] ([0x0-0x51051].org.pythonmac.unspecified.Teatro[899]) Exited with exit code: 255 > 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] Traceback (most recent call last): > 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] File "/Users/mef/Development/-Applications-/Teatro/Teatro.app/Contents/Resources/__boot__.py", line 103, in > 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] _argv_emulation() > 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] File "/Users/mef/Development/-Applications-/Teatro/Teatro.app/Contents/Resources/__boot__.py", line 101, in _argv_emulation > 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] _get_argvemulator().mainloop() > 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] File "/Users/mef/Development/-Applications-/Teatro/Teatro.app/Contents/Resources/__boot__.py", line 40, in mainloop > 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] stoptime = Evt.TickCount() + timeout > 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] AttributeError: 'module' object has no attribute 'TickCount' > 1/22/11 9:16:30 PM Teatro[982] Teatro Error > > > When I build using > python setup.py py2app Teatro.py without alias and argv_emulation in the setup.py > > > /usr/bin/strip: for architecture x86_64 object: /Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/Contents/Frameworks/Python.framework/Versions/2.6/Python malformed object (load command 3 cmdsize not a multiple of 8) > stripping saved 333408 bytes (8961700 / 9295108) > > as the last line of the build and in the build directory i get > dist.macosx-10.5-intel/ > > but away get the same result as above when I try to run the app > > > > I am sure it is obvious what is wrong but I have reach a dead end. > > Any help would be appreciated > > > Michael Ferraro > Assoc. Prof. > Art Dept. > Lehman College CUNY > Bronx, NY > > > > > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From michael at possibleworlds.com Sun Jan 23 19:34:10 2011 From: michael at possibleworlds.com (michael ferraro) Date: Sun, 23 Jan 2011 13:34:10 -0500 Subject: [Pythonmac-SIG] py2app not including /Library/Python/2.6/site-packages In-Reply-To: <56138F5E-B319-41F3-9352-7954BE312166@possibleworlds.com> References: <3CDD4ED9-0E1E-4862-B1EC-8E2FEF091AF9@possibleworlds.com> <56138F5E-B319-41F3-9352-7954BE312166@possibleworlds.com> Message-ID: <394E3543-00CE-4D53-B0CD-CD3E335A6457@possibleworlds.com> I have seen various posts regarding this problem over the years but I flummoxed by how I got here and what to do now that I am. I am running MacOS X 10.6.6 I started out using the system python 2.6. I built the 3d extensions (PyQt, numpy, PyOpenGL &c) and they are installed in /Library/Python/2.6/site-packages As I expected. My app runs fine when invoked directly from the Terminal. Poor internet search results trying to locate and install py2app resulted in the installation of ActiveStates pypm and Macports hg along with some variants of easy_install. These missteps seem to have installed another version of python 2.6 in the path of /Library/Frameworks/Python.framework chain with it own site-packages folder. As a result my installed 3d party extension were no longer found when starting the app from the Terminal. Once I removed this framework. and the .local folder created in my home folder. I also removed the .profile file that was modified (created) by one of the previous installs. I discovered some installed put a python in /usr/local/bin and removed it. I tested my app from the Terminal and all was good again. The sys.path variable prints the expected site-packages. ['/Users/mef/Development/-Applications-/Teatro', '/Library/Python/2.6/site-packages/setuptools-0.6c12dev_r88124-py2.6.egg', '/Library/Python/2.6/site-packages/py2app-0.5.2-py2.6.egg', '/Library/Python/2.6/site-packages/macholib-1.3-py2.6.egg', '/Library/Python/2.6/site-packages/modulegraph-0.8-py2.6.egg', '/Library/Python/2.6/site-packages/altgraph-0.7.0-py2.6.egg', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload', '/Library/Python/2.6/site-packages', '/Library/Python/2.6/site-packages/PIL', '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC', '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode'] After I run python setup.py py2app I run dist/Teatro.app and the sys.path contents printed to the console looks like this: 1/23/11 1:07:09 PM com.apple.launchd.peruser.501[420] ([0x0-0xec0ec].org.pythonmac.unspecified.Teatro[25180]) Exited with exit code: 255 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] ['/Users/mef/Development/-Applications-/Teatro', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/Contents/Resources', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/Contents/Resources', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python26.zip', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/plat-darwin', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/plat-mac', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/plat-mac/lib-scriptpackages', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/Extras/lib/python', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/lib-tk', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/lib-old', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/lib-dynload', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/Contents/Resources/lib/python2.6/site-packages.zip', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/Contents/Resources/lib/python2.6/site-packages', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/site-packages', 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/Users/mef/Development/-Applications-/Teatro'] What should I do here. I think from what I have read I should NOT add a site-packages link in /usr/lib/python2.6. or is it that I mangled the installation of the system python somehow ? m On Jan 23, 2011, at 12:33 PM, michael ferraro wrote: > I eliminated the 1st of my problems by turning off argv_emulation. That takes > care of the Evt.TickCount problem . > > But I am running afoul of the site-packages problem when I run the built app > > I will repost as an new thread for clarity > > m > > On Jan 22, 2011, at 9:34 PM, michael ferraro wrote: > >> Hello all and thanks for listening! >> >> I have scanned the archive and the web for current practices in packaging an Mac Python app with >> py2app. I have been successful before (i.e circa python 2.4 and Mac OS X 10.4). I am now working >> on under 10.6.6 and python 2.6.6.18 as shipped with the OS. I am using PyQt 4.8.2. as an i86_64 >> app. It runs fine from the terminal as >> python Teatro.py >> >> >> I used >> easy_install-2.6 -U py2app which retrieved and installed py2app 0.5.2. >> >> I used a couple of variation of what seem to be standard procedure to create the >> app including >> /Library/Frameworks/Python.framework/Versions/2.6/bin/py2applet --make-setup --alias --argv-emulation Teatro.py >> >> followed by: >> python setup.py py2app >> python setup.py py2app -A >> >> as well as >> /Library/Frameworks/Python.framework/Versions/2.6/bin/py2applet Teatro.py >> >> the setup.py file looks like this: >> >> """ >> This is a setup.py script generated by py2applet >> >> Usage: >> python setup.py py2app >> """ >> >> from setuptools import setup >> >> APP = ['Teatro.py'] >> DATA_FILES = [] >> OPTIONS = {'alias': True, 'argv_emulation': True} >> >> setup( >> app=APP, >> data_files=DATA_FILES, >> options={'py2app': OPTIONS}, >> setup_requires=['py2app'], >> ) >> >> when I try to run the app (Teatro.app or dist/Teatro depending on which procedure I used >> to build it) i get this: >> >> >> >> >> The console reports: >> >> 1/22/11 8:44:43 PM com.apple.launchd.peruser.501[420] ([0x0-0x51051].org.pythonmac.unspecified.Teatro[899]) Exited with exit code: 255 >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] Traceback (most recent call last): >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] File "/Users/mef/Development/-Applications-/Teatro/Teatro.app/Contents/Resources/__boot__.py", line 103, in >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] _argv_emulation() >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] File "/Users/mef/Development/-Applications-/Teatro/Teatro.app/Contents/Resources/__boot__.py", line 101, in _argv_emulation >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] _get_argvemulator().mainloop() >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] File "/Users/mef/Development/-Applications-/Teatro/Teatro.app/Contents/Resources/__boot__.py", line 40, in mainloop >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] stoptime = Evt.TickCount() + timeout >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] AttributeError: 'module' object has no attribute 'TickCount' >> 1/22/11 9:16:30 PM Teatro[982] Teatro Error >> >> >> When I build using >> python setup.py py2app Teatro.py without alias and argv_emulation in the setup.py >> >> >> /usr/bin/strip: for architecture x86_64 object: /Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/Contents/Frameworks/Python.framework/Versions/2.6/Python malformed object (load command 3 cmdsize not a multiple of 8) >> stripping saved 333408 bytes (8961700 / 9295108) >> >> as the last line of the build and in the build directory i get >> dist.macosx-10.5-intel/ >> >> but away get the same result as above when I try to run the app >> >> >> >> I am sure it is obvious what is wrong but I have reach a dead end. >> >> Any help would be appreciated >> >> >> Michael Ferraro >> Assoc. Prof. >> Art Dept. >> Lehman College CUNY >> Bronx, NY >> >> >> >> >> >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Mon Jan 24 02:04:10 2011 From: aahz at pythoncraft.com (Aahz) Date: Sun, 23 Jan 2011 17:04:10 -0800 Subject: [Pythonmac-SIG] py2app not including /Library/Python/2.6/site-packages In-Reply-To: <394E3543-00CE-4D53-B0CD-CD3E335A6457@possibleworlds.com> References: <3CDD4ED9-0E1E-4862-B1EC-8E2FEF091AF9@possibleworlds.com> <56138F5E-B319-41F3-9352-7954BE312166@possibleworlds.com> <394E3543-00CE-4D53-B0CD-CD3E335A6457@possibleworlds.com> Message-ID: <20110124010410.GB19589@panix.com> On Sun, Jan 23, 2011, michael ferraro wrote: > > I am running MacOS X 10.6.6 I started out using the system python 2.6. I built the > 3d extensions (PyQt, numpy, PyOpenGL &c) and they are installed in > /Library/Python/2.6/site-packages > > As I expected. My app runs fine when invoked directly from the Terminal. Short answer (someone may come along with a longer one): use the python.org installer. If you use Python 2.7, pick the 32-bit version unless you're absolutely certain ALL your users are on 10.6. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "All problems in computer science can be solved by another level of indirection." --Butler Lampson From michael at possibleworlds.com Mon Jan 24 02:53:26 2011 From: michael at possibleworlds.com (michael ferraro) Date: Sun, 23 Jan 2011 20:53:26 -0500 Subject: [Pythonmac-SIG] py2app not including /Library/Python/2.6/site-packages In-Reply-To: <20110124010410.GB19589@panix.com> References: <3CDD4ED9-0E1E-4862-B1EC-8E2FEF091AF9@possibleworlds.com> <56138F5E-B319-41F3-9352-7954BE312166@possibleworlds.com> <394E3543-00CE-4D53-B0CD-CD3E335A6457@possibleworlds.com> <20110124010410.GB19589@panix.com> Message-ID: how about I do a sys.path.append ("/Library/Python/2.6/site-packages") in my main? On Jan 23, 2011, at 8:04 PM, Aahz wrote: > On Sun, Jan 23, 2011, michael ferraro wrote: >> >> I am running MacOS X 10.6.6 I started out using the system python 2.6. I built the >> 3d extensions (PyQt, numpy, PyOpenGL &c) and they are installed in >> /Library/Python/2.6/site-packages >> >> As I expected. My app runs fine when invoked directly from the Terminal. > > Short answer (someone may come along with a longer one): use the > python.org installer. If you use Python 2.7, pick the 32-bit version > unless you're absolutely certain ALL your users are on 10.6. > -- > Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ > > "All problems in computer science can be solved by another level of > indirection." --Butler Lampson > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > From hraban at fiee.net Mon Jan 24 09:30:38 2011 From: hraban at fiee.net (Henning Hraban Ramm) Date: Mon, 24 Jan 2011 09:30:38 +0100 Subject: [Pythonmac-SIG] py2app not including /Library/Python/2.6/site-packages In-Reply-To: References: <3CDD4ED9-0E1E-4862-B1EC-8E2FEF091AF9@possibleworlds.com> <56138F5E-B319-41F3-9352-7954BE312166@possibleworlds.com> <394E3543-00CE-4D53-B0CD-CD3E335A6457@possibleworlds.com> <20110124010410.GB19589@panix.com> Message-ID: Am 2011-01-24 um 02:53 schrieb michael ferraro: > how about I do a > sys.path.append ("/Library/Python/2.6/site-packages") > in my main? How should such an absolute path help in a py2app packaged app? Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From michael at possibleworlds.com Mon Jan 24 15:10:37 2011 From: michael at possibleworlds.com (michael ferraro) Date: Mon, 24 Jan 2011 09:10:37 -0500 Subject: [Pythonmac-SIG] py2app not including /Library/Python/2.6/site-packages In-Reply-To: References: <3CDD4ED9-0E1E-4862-B1EC-8E2FEF091AF9@possibleworlds.com> <56138F5E-B319-41F3-9352-7954BE312166@possibleworlds.com> <394E3543-00CE-4D53-B0CD-CD3E335A6457@possibleworlds.com> <20110124010410.GB19589@panix.com> Message-ID: it wont deploy without an installer but at least it runs! m On Jan 24, 2011, at 3:30 AM, Henning Hraban Ramm wrote: > > Am 2011-01-24 um 02:53 schrieb michael ferraro: > >> how about I do a >> sys.path.append ("/Library/Python/2.6/site-packages") >> in my main? > > How should such an absolute path help in a py2app packaged app? > > > Greetlings from Lake Constance! > Hraban > --- > http://www.fiee.net > https://www.cacert.org (I'm an assurer) > > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > From cweisiger at msg.ucsf.edu Mon Jan 24 17:13:08 2011 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Mon, 24 Jan 2011 08:13:08 -0800 Subject: [Pythonmac-SIG] My first Python Program In-Reply-To: References: <4BA9D286-C16F-43E9-A0F6-2D3138733D41@gmail.com> Message-ID: Your main issue here wasn't with Python, but with Terminal; you didn't know how to use it to navigate your operating system and run files. You should check out Massimo's links for more information on that stuff. Terminal is basically like another version of the Finder: it can do everything the graphical interface can do, but it does it by typing commands into the command line instead of through the mouse and some keyboard shortcuts. Some tasks are easier with the Finder; others are easier with the commandline. It pays to be able to use both effectively. (Terminal gives you a Unix-style command prompt, by the way, so the syntax and many programs are the same if you're on OSX or Linux or Unix or BSD, etc.) -Chris On Sat, Jan 22, 2011 at 2:02 PM, John Parker wrote: > Thanks to all for your help. > > I was able to successfully run my first program all be it was very simple. > > I have ordered a Python for Dummies book from Amazon but it hasn't arrived > yet. I think that will help initially until I get familiar with this > environment. > > Thank you all for your information and empowering me to run my program. > > Happy Python Programming to All!! > > Aloha, > > John > > > > On 1/22/11 11:47 AM, "Massimo Di Stefano" > wrote: > > > Hi John, > > > > > > to run a python (.py) file, from the shell type : > > > > > > python /path/to/your/file.py (just drug'n'drop the file inside the > terminal > > shell) > > > > to know the directory where your shell is running type the command : > > > >> pwd > > > > it will show you the path. > > > > to go inside the directory type : > > > >> cd /path/to/the/directory > > > > this [1] is a simple list of the bash commands in osx : > > > > [1] http://ss64.com/osx/ > > > > and this [2] the standard python tutorial : > > > > [2] http://docs.python.org/tutorial/ > > > > you can also try to buy a book about python that will help you to get > started > > there are a large number of book dedicated to python programming. > > > > > > Il giorno 22/gen/2011, alle ore 15.56, John Parker ha scritto: > > > >> Hello All, > >> > >> I'm a complete novice to Python and I just created my first program for > an > >> assignment in a Python class that I'm taking at the local community > college. > >> > >> The instructor didn't give us a book so, I'm trying to figure out one > >> important item. > >> > >> How to run my program. I know this is so basic for everyone but I just > >> started this class and this is my first exposure ever to this type of > >> environment. > >> > >> I have an iMac, running python V2.6.1 > >> > >> My program is located in this directory: > >> > >> File location: /Users/parkjv1/Birth_Month.py > >> > >> When I open the terminal: > >> > >> I'm presented with this info: cpe-66-75-97-27: ~parkjv1$ > >> > >> Is this my /users/parkjv1 directory? > >> > >> When I type my file name Birth_Month.py I get an error indicating that > >> command not found. > >> > >> So, where do I call my program so that it will run? > >> > >> Thanks, > >> > >> John > >> > >> > >> _______________________________________________ > >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org > >> http://mail.python.org/mailman/listinfo/pythonmac-sig > >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > >> > >> > >> > >> On 1/21/11 8:40 AM, "Bill Janssen" wrote: > >> > >>> Charles Hartman wrote: > >>> > >>>> it would seem to be short-sighted for anyone interested in Python on > >>>> the Mac not to support py2app as fully as possible. > >>> > >>> You calling me short-sighted, Charles? > >>> > >>> That's OK -- it's true, you know; I've been wearing thick glasses since > >>> I was a kid :-). But I don't know that it has much to do with py2app. > >>> I think py2app is great, and I believe I even used it, once -- wanted > to > >>> make a Preference Pane with Python, and couldn't figure out how to do > it > >>> otherwise. > >>> > >>> But in general I've not needed it -- I just use Xcode and the system > >>> Python, and there's no need to bundle another Python with that > approach. > >>> I should probably figure out how to use py2app with that approach, > >>> though; it might be more bullet-proof. > >>> > >>> Bill > >>> _______________________________________________ > >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org > >>> http://mail.python.org/mailman/listinfo/pythonmac-sig > >>> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > >> > >> > >> _______________________________________________ > >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org > >> http://mail.python.org/mailman/listinfo/pythonmac-sig > >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From janssen at parc.com Mon Jan 24 18:04:24 2011 From: janssen at parc.com (Bill Janssen) Date: Mon, 24 Jan 2011 09:04:24 PST Subject: [Pythonmac-SIG] py2app not including /Library/Python/2.6/site-packages In-Reply-To: <394E3543-00CE-4D53-B0CD-CD3E335A6457@possibleworlds.com> References: <3CDD4ED9-0E1E-4862-B1EC-8E2FEF091AF9@possibleworlds.com> <56138F5E-B319-41F3-9352-7954BE312166@possibleworlds.com> <394E3543-00CE-4D53-B0CD-CD3E335A6457@possibleworlds.com> Message-ID: <9592.1295888664@parc.com> Michael, I'm not sure what problem you are reporting? But some of those paths on sys.path look suspicious to me: "/usr/Extras/lib/python", for instance. Might want to look into how those got on your sys.path. Also, in last week's discussion, we didn't really cover "setuptools" and "easy_install", as they're not Mac-specific. But, after years of fighting with setuptools ("easy_install" is a part of that), trying to get it to do what I need done, my advice would be to steer clear of using it, as well. It's not clear how it will interact with the other package control systems you mention, such as MacPorts and pypm. Bill michael ferraro wrote: > I have seen various posts regarding this problem over the years but I flummoxed > by how I got here and what to do now that I am. > > I am running MacOS X 10.6.6 I started out using the system python 2.6. I built the > 3d extensions (PyQt, numpy, PyOpenGL &c) and they are installed in > /Library/Python/2.6/site-packages > > As I expected. My app runs fine when invoked directly from the Terminal. > > Poor internet search results trying to locate and install py2app resulted > in the installation of ActiveStates pypm and Macports hg along with some > variants of easy_install. These missteps seem to have installed another > version of python 2.6 in the path of /Library/Frameworks/Python.framework > chain with it own site-packages folder. > > As a result my installed 3d party extension were no longer found when starting > the app from the Terminal. Once I removed this framework. and the .local folder > created in my home folder. I also removed the .profile file that was modified > (created) by one of the previous installs. I discovered some installed put a > python in /usr/local/bin and removed it. > > I tested my app from the Terminal and all was good again. The sys.path variable > prints the expected site-packages. > > ['/Users/mef/Development/-Applications-/Teatro', > '/Library/Python/2.6/site-packages/setuptools-0.6c12dev_r88124-py2.6.egg', > '/Library/Python/2.6/site-packages/py2app-0.5.2-py2.6.egg', > '/Library/Python/2.6/site-packages/macholib-1.3-py2.6.egg', > '/Library/Python/2.6/site-packages/modulegraph-0.8-py2.6.egg', > '/Library/Python/2.6/site-packages/altgraph-0.7.0-py2.6.egg', > '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip', > '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6', > '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin', > '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac', > '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages', > '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python', > '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk', > '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old', > '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload', > '/Library/Python/2.6/site-packages', > '/Library/Python/2.6/site-packages/PIL', > '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC', > '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode'] > > > After I run python setup.py py2app > I run dist/Teatro.app and the sys.path contents printed to the console looks like this: > > 1/23/11 1:07:09 PM com.apple.launchd.peruser.501[420] ([0x0-0xec0ec].org.pythonmac.unspecified.Teatro[25180]) Exited with exit code: 255 > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] ['/Users/mef/Development/-Applications-/Teatro', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/Contents/Resources', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/Contents/Resources', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python26.zip', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/plat-darwin', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/plat-mac', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/plat-mac/lib-scriptpackages', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/Extras/lib/python', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/lib-tk', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/lib-old', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/lib-dynload', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/Contents/Resources/lib/python2.6/site-packages.zip', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/Contents/Resources/lib/python2.6/site-packages', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/usr/lib/python2.6/site-packages', > 1/23/11 1:07:23 PM [0x0-0xf20f2].org.pythonmac.unspecified.Teatro[25233] '/Users/mef/Development/-Applications-/Teatro'] > > > What should I do here. I think from what I have read I should NOT add a site-packages link in > /usr/lib/python2.6. or is it that I mangled the installation of the system python somehow ? > > > > m > > > > > > On Jan 23, 2011, at 12:33 PM, michael ferraro wrote: > > > I eliminated the 1st of my problems by turning off argv_emulation. That takes > > care of the Evt.TickCount problem . > > > > But I am running afoul of the site-packages problem when I run the built app > > > > I will repost as an new thread for clarity > > > > m > > > > On Jan 22, 2011, at 9:34 PM, michael ferraro wrote: > > > >> Hello all and thanks for listening! > >> > >> I have scanned the archive and the web for current practices in packaging an Mac Python app with > >> py2app. I have been successful before (i.e circa python 2.4 and Mac OS X 10.4). I am now working > >> on under 10.6.6 and python 2.6.6.18 as shipped with the OS. I am using PyQt 4.8.2. as an i86_64 > >> app. It runs fine from the terminal as > >> python Teatro.py > >> > >> > >> I used > >> easy_install-2.6 -U py2app which retrieved and installed py2app 0.5.2. > >> > >> I used a couple of variation of what seem to be standard procedure to create the > >> app including > >> /Library/Frameworks/Python.framework/Versions/2.6/bin/py2applet --make-setup --alias --argv-emulation Teatro.py > >> > >> followed by: > >> python setup.py py2app > >> python setup.py py2app -A > >> > >> as well as > >> /Library/Frameworks/Python.framework/Versions/2.6/bin/py2applet Teatro.py > >> > >> the setup.py file looks like this: > >> > >> """ > >> This is a setup.py script generated by py2applet > >> > >> Usage: > >> python setup.py py2app > >> """ > >> > >> from setuptools import setup > >> > >> APP = ['Teatro.py'] > >> DATA_FILES = [] > >> OPTIONS = {'alias': True, 'argv_emulation': True} > >> > >> setup( > >> app=APP, > >> data_files=DATA_FILES, > >> options={'py2app': OPTIONS}, > >> setup_requires=['py2app'], > >> ) > >> > >> when I try to run the app (Teatro.app or dist/Teatro depending on which procedure I used > >> to build it) i get this: > >> > >> > >> > >> > >> The console reports: > >> > >> 1/22/11 8:44:43 PM com.apple.launchd.peruser.501[420] ([0x0-0x51051].org.pythonmac.unspecified.Teatro[899]) Exited with exit code: 255 > >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] Traceback (most recent call last): > >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] File "/Users/mef/Development/-Applications-/Teatro/Teatro.app/Contents/Resources/__boot__.py", line 103, in > >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] _argv_emulation() > >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] File "/Users/mef/Development/-Applications-/Teatro/Teatro.app/Contents/Resources/__boot__.py", line 101, in _argv_emulation > >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] _get_argvemulator().mainloop() > >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] File "/Users/mef/Development/-Applications-/Teatro/Teatro.app/Contents/Resources/__boot__.py", line 40, in mainloop > >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] stoptime = Evt.TickCount() + timeout > >> 1/22/11 9:16:30 PM [0x0-0x5e05e].org.pythonmac.unspecified.Teatro[982] AttributeError: 'module' object has no attribute 'TickCount' > >> 1/22/11 9:16:30 PM Teatro[982] Teatro Error > >> > >> > >> When I build using > >> python setup.py py2app Teatro.py without alias and argv_emulation in the setup.py > >> > >> > >> /usr/bin/strip: for architecture x86_64 object: /Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/Contents/Frameworks/Python.framework/Versions/2.6/Python malformed object (load command 3 cmdsize not a multiple of 8) > >> stripping saved 333408 bytes (8961700 / 9295108) > >> > >> as the last line of the build and in the build directory i get > >> dist.macosx-10.5-intel/ > >> > >> but away get the same result as above when I try to run the app > >> > >> > >> > >> I am sure it is obvious what is wrong but I have reach a dead end. > >> > >> Any help would be appreciated > >> > >> > >> Michael Ferraro > >> Assoc. Prof. > >> Art Dept. > >> Lehman College CUNY > >> Bronx, NY > >> > >> > >> > >> > >> > >> > >> > >> _______________________________________________ > >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org > >> http://mail.python.org/mailman/listinfo/pythonmac-sig > >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From Chris.Barker at noaa.gov Mon Jan 24 17:55:57 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 24 Jan 2011 08:55:57 -0800 Subject: [Pythonmac-SIG] py2app not including /Library/Python/2.6/site-packages In-Reply-To: References: <3CDD4ED9-0E1E-4862-B1EC-8E2FEF091AF9@possibleworlds.com> <56138F5E-B319-41F3-9352-7954BE312166@possibleworlds.com> <394E3543-00CE-4D53-B0CD-CD3E335A6457@possibleworlds.com> <20110124010410.GB19589@panix.com> Message-ID: <4D3DAF1D.5030403@noaa.gov> On 1/24/11 6:10 AM, michael ferraro wrote: > it wont deploy without an installer but at least it runs! I suppose so -- but what's the point? If you want to have a program run only with a python install like yours, you don't need py2app... It's still unclear to me what py2app is expected to be able to do with Apple's Python. but in practice, we generally use it with the python.org installer, as that gets you a fully independent app bundle. In theory, you can build an app this way on 10.6, and it can run on 10.3.9 and above. In practice, all your user-installed packages have to be built for 10.3.9 and above, too, and that is a bit tricky. However, most folks building binaries are trying to support that, so it certainly can work. I don't know bout QT, though -- I don't use it. If you want to continue with Apple's python, you might try: 1) adding the extra stuff in as required packages in your setup.py or 2) writing some post-flight code into your setup.py that copies what you need into the app bundle --it's just a well-structured directory, after all. good luck! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From sridharr at activestate.com Thu Jan 20 23:20:33 2011 From: sridharr at activestate.com (Sridhar Ratnakumar) Date: Thu, 20 Jan 2011 14:20:33 -0800 Subject: [Pythonmac-SIG] Fwd: ANN: ActivePython 2.6.6.18 is now available (ActiveTcl 64-bit) Message-ID: <4D38B531.8040100@activestate.com> Hi, Following 2.7 and 3.1, ActivePython 2.6 too is now updated to use ActiveTcl 8.5 64-bit on OSX. -------- Original Message -------- From: Sridhar Ratnakumar Subject: ANN: ActivePython 2.6.6.18 is now available Date: Thu, 20 Jan 2011 14:18:11 -0800 To: python-announce-list at python.org, python-list at python.org ActiveState is pleased to announce ActivePython 2.6.6.18, a complete, ready-to-install binary distribution of Python 2.6. Among other updates, this releases brings "postinstall" support to PyPM to facilitate installation of modules such as PyIMSL. http://www.activestate.com/activepython/downloads What's New in ActivePython-2.6.6.18 =================================== New Features & Upgrades ----------------------- - Upgrade to Tcl/Tk 8.5.9 (`changes `_) - Security upgrade to openssl-0.9.8q - [MacOSX] Tkinter now requires ActiveTcl 8.5 64-bit (not Apple's Tcl/Tk 8.5 on OSX) - Upgrade to PyPM 1.3.0: - Programmatic use via ``pypm.cmd(['install', 'foo'])`` - Support for postinstall and conditional user-notes - Package updates: - pip-0.8.2 Noteworthy Changes & Bug Fixes ------------------------------ - [Windows 64-bit] `issue8275 `_: turn off optimization for the ctypes module - PyPM bug fixes: - Fix needless truncation of output when piping (eg: ``pypm list | less``) - Respect download cache of ``*.pypm`` packages (don't redownload) - Bug #88882: Fix pickle incompatability (sqlite) on Python 3.x What is ActivePython? ===================== ActivePython is ActiveState's binary distribution of Python. Builds for Windows, Mac OS X, Linux are made freely available. Solaris, HP-UX and AIX builds, and access to older versions are available in ActivePython Business, Enterprise and OEM editions: http://www.activestate.com/python ActivePython includes the Python core and the many core extensions: zlib and bzip2 for data compression, the Berkeley DB (bsddb) and SQLite (sqlite3) database libraries, OpenSSL bindings for HTTPS support, the Tix GUI widgets for Tkinter, ElementTree for XML processing, ctypes (on supported platforms) for low-level library access, and others. The Windows distribution ships with PyWin32 -- a suite of Windows tools developed by Mark Hammond, including bindings to the Win32 API and Windows COM. ActivePython also includes a binary package manager for Python (PyPM) that can be used to install packages much easily. For example: C:\>pypm install mysql-python [...] C:\>python >>> import MySQLdb >>> See this page for full details: http://docs.activestate.com/activepython/2.6/whatsincluded.html As well, ActivePython ships with a wealth of documentation for both new and experienced Python programmers. In addition to the core Python docs, ActivePython includes the "What's New in Python" series, "Dive into Python", the Python FAQs & HOWTOs, and the Python Enhancement Proposals (PEPs). An online version of the docs can be found here: http://docs.activestate.com/activepython/2.6/ We would welcome any and all feedback to: activepython-feedback at activestate.com Please file bugs against ActivePython at: http://bugs.activestate.com/enter_bug.cgi?product=ActivePython Supported Platforms =================== ActivePython is available for the following platforms: - Windows (x86 and x64) - Mac OS X (x86 and x86_64; 10.5+) - Linux (x86 and x86_64) - Solaris/SPARC (32-bit and 64-bit) (Business, Enterprise or OEM edition only) - Solaris/x86 (32-bit) (Business, Enterprise or OEM edition only) - HP-UX/PA-RISC (32-bit) (Business, Enterprise or OEM edition only) - HP-UX/IA-64 (32-bit and 64-bit) (Enterprise or OEM edition only) - AIX/PowerPC (32-bit and 64-bit) (Business, Enterprise or OEM edition only) More information about the Business Edition can be found here: http://www.activestate.com/business-edition Custom builds are available in the Enterprise Edition: http://www.activestate.com/enterprise-edition Thanks, and enjoy! The Python Team -- Sridhar Ratnakumar sridharr at activestate.com From dan.odonovan at gmail.com Sat Jan 22 22:04:08 2011 From: dan.odonovan at gmail.com (Daniel O'Donovan) Date: Sat, 22 Jan 2011 16:04:08 -0500 Subject: [Pythonmac-SIG] My first Python Program In-Reply-To: References: Message-ID: <5CA2A656-F9F3-4D51-B258-7B7F0E2EBB91@gmail.com> > I'm a complete novice to Python and I just created my first program for an > assignment in a Python class that I'm taking at the local community college. Hi John, Welcome the user group! > I'm presented with this info: cpe-66-75-97-27: ~parkjv1$ > > Is this my /users/parkjv1 directory? Yes it is. > When I type my file name Birth_Month.py I get an error indicating that > command not found. There are many different ways to do this, but for now I think the best idea would be to type $ python Birth_Month.py To tell the terminal that you want Python to run your program. I hope that helps, after the initial learning curve I think you'll find learning python and programming hugely rewarding! Good luck and stay in touch. Dan Daniel O'Donovan dan.odonovan at gmail.com From lou_boog2000 at yahoo.com Mon Jan 24 19:14:21 2011 From: lou_boog2000 at yahoo.com (Lou Pecora) Date: Mon, 24 Jan 2011 10:14:21 -0800 (PST) Subject: [Pythonmac-SIG] How to get a Mac OS X version of Tcl/Tk rather than X11 version. Message-ID: <960836.10021.qm@web34405.mail.mud.yahoo.com> I have an installation of Python 2.6.4 on my MacBook Pro (OS X 10.6) that by default uses X11 windows and dialogs rather than the Mac version of those GUI items. In my googling and exchanges on other support groups I've come down to the problem may be with the Tcl/Tk installation using the "generic" X11 GUI rather than the Mac version. Does anyone know how I can change that in the Tk part of the python framework? I think this problem came up in the iPython email list, but I didn't get enough info from the messages there. More Info: The python framework is part of the SAGE package which I installed from source. I did this on my Mac Pro (system 10.4) and it works well with Mac windows for matplotlib and Mac open/save dialogs for Tk calls. But on my MacBook Pro I get X11 windows and dialogs. I want the Mac versions. Even more info: If you're interested, below is the original message I put up on the SAGE support group and was told it's a problem with the type of Tcl/Tk installed. -- Lou Pecora, my views are my own. ---------------------------------------------------------------------------------- I have an installation of SAGE (from source) on my Mac laptop in which using the tcl/tk library to plot (using TKAgg backend) or call tk file open/save dialogs calls the X11 versions and not the native Mac versions of dialogs and windows. I want to get the Mac versions. I posted about this on this list recently and now after a response here and much googling I have the sense that the problem is that I have a SAGE package with an X11 version of the tk library rather than the Mac one. I compiled SAGE from source on my Mac laptop. That went perfectly. I don't know how I got the X11 version since I also compiled SAGE from source on my Mac desktop where the plotting and file dialogs are the correct Mac versions, not X11. The only difference is that the laptop is Mac OS X 10.6 and the desktop is 10.4. If that matters, I don't know. Does anyone know how to get the Mac version installed in the SAGE source-compile installation? I have not found an answer to this elsewhere. I'm hoping someone here knows how this is done with the source installation. Thanks for any help or pointers. -- Lou Pecora From cweisiger at msg.ucsf.edu Mon Jan 24 23:52:43 2011 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Mon, 24 Jan 2011 14:52:43 -0800 Subject: [Pythonmac-SIG] Determining if I need an import Message-ID: I've inherited a large codebase that is practically the definition of "legacy", with all that entails. I've spent a lot of time removing unused code, renaming variables, creating classes, moving global variables to locals (let's stuff all our program state into a single module and then just import that whenever we want to access it!), and so on, and now I want to start cleaning up the dependency chains between different modules. There's several places where I've had to move an import statement from being at the top of the module to being inside a function right before it's used, to prevent circular dependencies from causing imports to fail at program start. I wouldn't be surprised if I've rendered many of these imports moot, but short of a fair amount of painful grepping across ~20k lines of Python, I don't know of an easy way to find them. Is there a tool that examines your actual and apparent dependencies? I know there are programs that will generate dependency graphs, but for those there's little difference between a tight coupling and a single import statement that isn't actually needed. (Though if you'd care to recommend a dependency graph generator, I'd like to hear about that too) -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From parkjv1 at gmail.com Tue Jan 25 05:33:20 2011 From: parkjv1 at gmail.com (John Parker) Date: Mon, 24 Jan 2011 18:33:20 -1000 Subject: [Pythonmac-SIG] My first Python Program In-Reply-To: Message-ID: Thanks for the info Chris. Yes, I have a lot to learn. Happy Python Programming! Aloha, John On 1/24/11 6:13 AM, "Chris Weisiger" wrote: > Your main issue here wasn't with Python, but with Terminal; you didn't know > how to use it to navigate your operating system and run files. You should > check out Massimo's links for more information on that stuff. Terminal is > basically like another version of the Finder: it can do everything the > graphical interface can do, but it does it by typing commands into the command > line instead of through the mouse and some keyboard shortcuts. Some tasks are > easier with the Finder; others are easier with the commandline. It pays to be > able to use both effectively. > > (Terminal gives you a Unix-style command prompt, by the way, so the syntax and > many programs are the same if you're on OSX or Linux or Unix or BSD, etc.) > > -Chris > > On Sat, Jan 22, 2011 at 2:02 PM, John Parker wrote: >> Thanks to all for your help. >> >> I was able to successfully run my first program all be it was very simple. >> >> I have ordered a Python for Dummies book from Amazon but it hasn't arrived >> yet. ?I think that will help initially until I get familiar with this >> environment. >> >> Thank you all for your information and empowering me to run my program. >> >> Happy Python Programming to All!! >> >> Aloha, >> >> John >> >> >> >> On 1/22/11 11:47 AM, "Massimo Di Stefano" wrote: >> >>> > Hi John, >>> > >>> > >>> > to run a python (.py) file, from the shell type : >>> > >>> > >>> > python /path/to/your/file.py ?(just drug'n'drop the file inside the >>> terminal >>> > shell) >>> > >>> > to know the directory where your shell is running type the command : >>> > >>>> >> pwd >>> > >>> > it will show you the path. >>> > >>> > to go inside the directory type : >>> > >>>> >> cd /path/to/the/directory >>> > >>> > this [1] is a simple list of the bash commands in osx : >>> > >>> > [1] http://ss64.com/osx/ >>> > >>> > and this [2] the standard python tutorial : >>> > >>> > [2] http://docs.python.org/tutorial/ >>> > >>> > you can also try to buy a book about python that will help you to get >>> started >>> > there are a large number of book dedicated to python programming. >>> > >>> > >>> > Il giorno 22/gen/2011, alle ore 15.56, John Parker ha scritto: >>> > >>>> >> Hello All, >>>> >> >>>> >> I'm a complete novice to Python and I just created my first program for an >>>> >> assignment in a Python class that I'm taking at the local community >>>> college. >>>> >> >>>> >> The instructor didn't give us a book so, I'm trying to figure out one >>>> >> important item. >>>> >> >>>> >> How to run my program. ?I know this is so basic for everyone but I just >>>> >> started this class and this is my first exposure ever to this type of >>>> >> environment. >>>> >> >>>> >> I have an iMac, running python V2.6.1 >>>> >> >>>> >> My program is located in this directory: >>>> >> >>>> >> File location: /Users/parkjv1/Birth_Month.py >>>> >> >>>> >> When I open the terminal: >>>> >> >>>> >> I'm presented with this info: cpe-66-75-97-27: ~parkjv1$ >>>> >> >>>> >> Is this my /users/parkjv1 directory? >>>> >> >>>> >> When I type my file name Birth_Month.py I get an error indicating that >>>> >> command not found. >>>> >> >>>> >> So, where do I call my program so that it will run? >>>> >> >>>> >> Thanks, >>>> >> >>>> >> John >>>> >> >>>> >> >>>> >> _______________________________________________ >>>> >> Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org >>>> >> http://mail.python.org/mailman/listinfo/pythonmac-sig >>>> >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG >>>> >> >>>> >> >>>> >> >>>> >> On 1/21/11 8:40 AM, "Bill Janssen" wrote: >>>> >> >>>>> >>> Charles Hartman wrote: >>>>> >>> >>>>>> >>>> it would seem to be short-sighted for anyone interested in Python on >>>>>> >>>> the Mac not to support py2app as fully as possible. >>>>> >>> >>>>> >>> You calling me short-sighted, Charles? >>>>> >>> >>>>> >>> That's OK -- it's true, you know; I've been wearing thick glasses >>>>> since >>>>> >>> I was a kid :-). ?But I don't know that it has much to do with py2app. >>>>> >>> I think py2app is great, and I believe I even used it, once -- wanted to >>>>> >>> make a Preference Pane with Python, and couldn't figure out how to do it >>>>> >>> otherwise. >>>>> >>> >>>>> >>> But in general I've not needed it -- I just use Xcode and the system >>>>> >>> Python, and there's no need to bundle another Python with that >>>>> approach. >>>>> >>> I should probably figure out how to use py2app with that approach, >>>>> >>> though; it might be more bullet-proof. >>>>> >>> >>>>> >>> Bill >>>>> >>> _______________________________________________ >>>>> >>> Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org >>>>> >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >>>>> >>> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG >>>> >> >>>> >> >>>> >> _______________________________________________ >>>> >> Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org >>>> >> http://mail.python.org/mailman/listinfo/pythonmac-sig >>>> >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG >>> > >> >> >> _______________________________________________ >> Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at possibleworlds.com Tue Jan 25 07:57:58 2011 From: michael at possibleworlds.com (michael ferraro) Date: Tue, 25 Jan 2011 01:57:58 -0500 Subject: [Pythonmac-SIG] py2app not including /Library/Python/2.6/site-packages In-Reply-To: <4D3DAF1D.5030403@noaa.gov> References: <3CDD4ED9-0E1E-4862-B1EC-8E2FEF091AF9@possibleworlds.com> <56138F5E-B319-41F3-9352-7954BE312166@possibleworlds.com> <394E3543-00CE-4D53-B0CD-CD3E335A6457@possibleworlds.com> <20110124010410.GB19589@panix.com> <4D3DAF1D.5030403@noaa.gov> Message-ID: Thank you all for your attention to this matter. I should clarify- My apps are used in intense live animation production applications. Having an app the runs like an app, can be executed from the dock and in all aspects seems like a real Mac- app, for me, makes it possible to experiment with new models of media production. This is my stock-and-trade. While --I --can run the app as a python script and deal with the strange python menu that shows up. Not everyone can. In the heat of production having an bundled app w/ icons &c., makes our situation much less stressful and much less prone to error. So,...py2app. It looks like an app, smells like app and, most importantly acts like an app. It may be a small quality in an app. but it is a very important quality in an app for what I do. Adding insult to injury, I am constantly in development. So ... I am never ready to commit (no pun intended). I need to fix things at a crucial moment. I need to add a featur that no one anticipated. I can't be rigid and orthodox here py2app is 99.9 percent exactly what I need. It it excellent and has been a terrific help to me a and to the the community. I just got lost and frustrated in the morass of development. Using Apple's installed python means one less install and, one less opportunity for problem. It is probably shortsighted. Given everything, installing a python.org version of python might make things more consistent and easier. thans again -- m On Jan 24, 2011, at 11:55 AM, Christopher Barker wrote: > On 1/24/11 6:10 AM, michael ferraro wrote: >> it wont deploy without an installer but at least it runs! > > I suppose so -- but what's the point? If you want to have a program run only with a python install like yours, you don't need py2app... > > It's still unclear to me what py2app is expected to be able to do with Apple's Python. but in practice, we generally use it with the python.org installer, as that gets you a fully independent app bundle. > > In theory, you can build an app this way on 10.6, and it can run on 10.3.9 and above. > > In practice, all your user-installed packages have to be built for 10.3.9 and above, too, and that is a bit tricky. However, most folks building binaries are trying to support that, so it certainly can work. > > I don't know bout QT, though -- I don't use it. > > If you want to continue with Apple's python, you might try: > > 1) adding the extra stuff in as required packages in your setup.py > > or > > 2) writing some post-flight code into your setup.py that copies what you need into the app bundle --it's just a well-structured directory, after all. > > good luck! > > -Chris > > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > From brendan.simon at etrix.com.au Tue Jan 25 10:20:56 2011 From: brendan.simon at etrix.com.au (Brendan Simon (eTRIX)) Date: Tue, 25 Jan 2011 20:20:56 +1100 Subject: [Pythonmac-SIG] C++ ABI 1002/102 incompatibility with wxPython Message-ID: <4D3E95F8.5000101@etrix.com.au> I have a wxPython app that is built with py2app. A user recently reported the following error when trying to run the app. Fatal Error: Mismatch between the program and library build versions detected. The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6), and your program used 2.8 (no debug,Unicode,compiler with C++ ABI 102,wx containers,compatible with 2.6). Abort trap logout It appears to be a difference in the wx libraries on the target system and the wx libraries on the build system. Unfortunately, at this stage, I do not know what the OS X version is on the target system. The app was built using Python 2.5.4, (wxPython 2.8.11.0 or 2.8.4.2 ??) on OS X 10.6.6. Is there anyway to fix this with a py2app setting ?? Doesn't py2app copy all the libraries to the app bundle ?? I guess that doesn't guarantee that the libraries will load on any OS. What about path settings ?? I presume others have solved this before. Any suggestions ?? Many thanks, Brendan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Tue Jan 25 18:06:09 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 25 Jan 2011 09:06:09 -0800 Subject: [Pythonmac-SIG] C++ ABI 1002/102 incompatibility with wxPython In-Reply-To: <4D3E95F8.5000101@etrix.com.au> References: <4D3E95F8.5000101@etrix.com.au> Message-ID: <4D3F0301.3030209@noaa.gov> On 1/25/11 1:20 AM, Brendan Simon (eTRIX) wrote: > I have a wxPython app that is built with py2app. A user recently > reported the following error when trying to run the app. > > Fatal Error: Mismatch between the program and library build versions > detected. > The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx > containers,compatible with 2.6), > and your program used 2.8 (no debug,Unicode,compiler with C++ ABI > 102,wx containers,compatible with 2.6). > Abort trap > logout That looks odd to me -- as far as I can see (did I miss something?) the only difference is ABI 102 vs ABI 1002 -- that almost looks like a typo. I would ask on the wxPython list -- perhaps Robin will recognize those ABI numbers. And I"m not sure how to get those numbers at either run time or otherwise -- anyone know? Meanwhile a couple questions/thoughts: > It appears to be a difference in the wx libraries on the target system > and the wx libraries on the build system. > > Unfortunately, at this stage, I do not know what the OS X version is on > the target system. > > The app was built using Python 2.5.4, (wxPython 2.8.11.0 or 2.8.4.2 ??) > on OS X 10.6.6. Is that the "apple's" python? i.e. the one in: /System/Library/Frameworks/Python.framework/Versions/2.5 If so, that is likely your problem. py2app does not bundle up everything if you're using Apple's python, so your python install and your users may be different. > Is there anyway to fix this with a py2app setting ?? not until we figure out what's wrong... > Doesn't py2app copy all the libraries to the app bundle ?? it should, but it won't if you are using Apple's python, and sometimes things go wrong. wxPython puts itself in /usr/local/, while putting nifty sys.path manipulations in the python installs, so things can get a bit confused. But it's done so that one installer can support both python,org and apple pythons. > I guess that > doesn't guarantee that the libraries will load on any OS. no, it doesn't, but it should load on any version that your supporting libs are built for -- the standard wxPython installers are built for 10.4 and above (maybe 10.3.9 --not sure about that), and so is the python,org python -- are you using any other third-party libs that aren't pure python? debugging suggestions: -- use the python.org python if you are not already. -- add a "print sys.path" in your app (before importing wx) -- then check the console to see what it prints, both in and out of an .app bundle - that should give you a clue -- if you can have your user report what they get -- that will be best. -- take a look in the generated app bundle -- it's just a directory -- you can see what's in there, and it will give you a clue. > What about path settings ?? py2app should take care of that, but looking at sys.path will let you know if it's doing it "right" HTH, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From matthias.baas at gmail.com Tue Jan 25 21:19:58 2011 From: matthias.baas at gmail.com (Matthias Baas) Date: Tue, 25 Jan 2011 20:19:58 +0000 Subject: [Pythonmac-SIG] C++ ABI 1002/102 incompatibility with wxPython In-Reply-To: <4D3F0301.3030209@noaa.gov> References: <4D3E95F8.5000101@etrix.com.au> <4D3F0301.3030209@noaa.gov> Message-ID: <4D3F306E.7080005@gmail.com> On 25.01.11 17:06, Christopher Barker wrote: > On 1/25/11 1:20 AM, Brendan Simon (eTRIX) wrote: >> Fatal Error: Mismatch between the program and library build versions >> detected. >> The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx >> containers,compatible with 2.6), >> and your program used 2.8 (no debug,Unicode,compiler with C++ ABI >> 102,wx containers,compatible with 2.6). >> Abort trap >> logout > > That looks odd to me -- as far as I can see (did I miss something?) the > only difference is ABI 102 vs ABI 1002 -- that almost looks like a typo. It's not a typo, the numbers indicate the C++ ABI (Application Binary Interface) version the code uses. This defines stuff like how to call functions, the stack layout, how to handle exceptions, etc. All pieces of code in a program must use the same ABI version, otherwise those pieces can't be used together. The ABI version used by gcc has changed in the past which always means that *every* code a program uses has to be recompiled with the new compiler version. As far as I know, version 1002 is still the current one and it was introduced by gcc 3.4. Before that, the version was 102 (don't ask me how these numbers are formed. I have to admit, it's a bit of an odd numbering scheme...). You can find out the ABI version a particular version of gcc uses by running the following command: g++ -E -dM - =3.4) whereas the "program" contains parts that were built with a compiler that uses ABI 102 (such as gcc <3.4). But as mentioned above, it will only work when all components use the same ABI. Cheers, - Matthias - From Chris.Barker at noaa.gov Tue Jan 25 23:24:56 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 25 Jan 2011 14:24:56 -0800 Subject: [Pythonmac-SIG] C++ ABI 1002/102 incompatibility with wxPython In-Reply-To: <4D3F306E.7080005@gmail.com> References: <4D3E95F8.5000101@etrix.com.au> <4D3F0301.3030209@noaa.gov> <4D3F306E.7080005@gmail.com> Message-ID: <4D3F4DB8.4020107@noaa.gov> On 1/25/11 12:19 PM, Matthias Baas wrote: > It's not a typo, the numbers indicate the C++ ABI (Application Binary > Interface) version the code uses. > As far as I know, version 1002 is still the current one and it was > introduced by gcc 3.4. Before that, the version was 102 (don't ask me > how these numbers are formed. I have to admit, it's a bit of an odd > numbering scheme...). It's that odd numbering scheme that threw me. > You can find out the ABI version a particular version of gcc uses by > running the following command: > > g++ -E -dM - <56138F5E-B319-41F3-9352-7954BE312166@possibleworlds.com> <394E3543-00CE-4D53-B0CD-CD3E335A6457@possibleworlds.com> <20110124010410.GB19589@panix.com> <4D3DAF1D.5030403@noaa.gov> Message-ID: michael ferraro writes: > Using Apple's installed python means one less install and, one less > opportunity for problem. It is probably shortsighted. Given > everything, installing a python.org version of python might make > things more consistent and easier. Just to perhaps clarify one thing - the use of the python.org Python is only an installation issue for the development machine. py2app will include the relevant portions of the python.org framework within your application bundle, so it's not a requirement for any of your users. They'll still just see a single standalone application, which just happens to have no dependencies on their system's python. This can simplify things somewhat on the development machine too, since you can use the python.org python installation (independent from the OS version) on that machine for installing other third-party packages you may need, again without affecting the system python. Those packages also get included in the final app bundle by py2app. -- David From matthias.baas at gmail.com Wed Jan 26 00:47:00 2011 From: matthias.baas at gmail.com (Matthias Baas) Date: Tue, 25 Jan 2011 23:47:00 +0000 Subject: [Pythonmac-SIG] C++ ABI 1002/102 incompatibility with wxPython In-Reply-To: <4D3F4DB8.4020107@noaa.gov> References: <4D3E95F8.5000101@etrix.com.au> <4D3F0301.3030209@noaa.gov> <4D3F306E.7080005@gmail.com> <4D3F4DB8.4020107@noaa.gov> Message-ID: <4D3F60F4.3070900@gmail.com> On 25.01.11 22:24, Christopher Barker wrote: >> You can find out the ABI version a particular version of gcc uses by >> running the following command: >> >> g++ -E -dM - > Any idea how to see what ABI version a given binary was compiled against? Hm, I don't know. The above only prints a preprocessor symbol, so that one doesn't have to make it into the binary. But I think that error message was specific to wx anyway (it was not a generic error message from the linker, was it?), so maybe in general that information is not recorded in the binary at all. Whenever I experienced such an ABI mismatch before, it just resulted in a crash but not in such an error message (but that always was on Linux, maybe OSX is a bit different here...?). I just saw in the docs that OSX 10.3.8 and earlier was using gcc 3.3. The original poster said he's using 10.6.6, so couldn't it just be that his user was using an old OSX 10.3 install and that's where the mismatch comes from? Anyway, I think there's two things to do: 1) ask that user what OSX version he's running and 2) check all (C++) program dependencies where they come from and what compiler was used to build them (if it was built locally, check your build environment, otherwise check the documentation that comes with the binary or ask the maintainers). Cheers, - Matthias - From Chris.Barker at noaa.gov Wed Jan 26 00:56:06 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 25 Jan 2011 15:56:06 -0800 Subject: [Pythonmac-SIG] py2app not including /Library/Python/2.6/site-packages In-Reply-To: References: <3CDD4ED9-0E1E-4862-B1EC-8E2FEF091AF9@possibleworlds.com> <56138F5E-B319-41F3-9352-7954BE312166@possibleworlds.com> <394E3543-00CE-4D53-B0CD-CD3E335A6457@possibleworlds.com> <20110124010410.GB19589@panix.com> <4D3DAF1D.5030403@noaa.gov> Message-ID: <4D3F6316.6010700@noaa.gov> On 1/24/11 10:57 PM, michael ferraro wrote: > I should clarify- My apps are used in intense live animation production applications. > > Having an app the runs like an app, can be executed from the dock and in all > aspects seems like a real Mac- app, for me, makes it possible to experiment with > new models of media production. This is my stock-and-trade. yep -- it really nice if you use the GUI for other parts of your process. > Adding insult to injury, I am constantly in development. So ... I am never ready to commit > (no pun intended). I need to fix things at a crucial moment. I need to add a featur > that no one anticipated. I can't be rigid and orthodox here > > py2app is 99.9 percent exactly what I need. It it excellent and has been a terrific > help to me a and to the the community. I just got lost and frustrated in the > morass of development. I use it that way too. I have a few apps that are under constant development (some mine, and the Peppy editor). I use Py2app to build an Alias bundle, and then I have an app that looks, feels and acts like an app, but actually runs the development code and my Python install. I can't give it to anyone else, but I can set up others with a similar python install and set them up the same way. > Using Apple's installed python means one less install and, one less opportunity > for problem. I'd think that what you are trying to do should work. And if you can figure it out what went wrong, please report here. > It is probably shortsighted. Given everything, installing a python.org > version of python might make things more consistent and easier. I think so -- and yes, it's one more install, but it's a pretty darn easy one. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From lou_boog2000 at yahoo.com Wed Jan 26 16:06:21 2011 From: lou_boog2000 at yahoo.com (Lou Pecora) Date: Wed, 26 Jan 2011 07:06:21 -0800 (PST) Subject: [Pythonmac-SIG] C++ ABI 1002/102 incompatibility with wxPython In-Reply-To: <4D3F4DB8.4020107@noaa.gov> References: <4D3E95F8.5000101@etrix.com.au> <4D3F0301.3030209@noaa.gov> <4D3F306E.7080005@gmail.com> <4D3F4DB8.4020107@noaa.gov> Message-ID: <387145.4162.qm@web34402.mail.mud.yahoo.com> ----- Original Message ---- From: Christopher Barker To: Matthias Baas Cc: pythonmac-sig at python.org Sent: Tue, January 25, 2011 5:24:56 PM Subject: Re: [Pythonmac-SIG] C++ ABI 1002/102 incompatibility with wxPython On 1/25/11 12:19 PM, Matthias Baas wrote: > It's not a typo, the numbers indicate the C++ ABI (Application Binary > Interface) version the code uses. > As far as I know, version 1002 is still the current one and it was > introduced by gcc 3.4. Before that, the version was 102 (don't ask me > how these numbers are formed. I have to admit, it's a bit of an odd > numbering scheme...). It's that odd numbering scheme that threw me. > You can find out the ABI version a particular version of gcc uses by > running the following command: > > g++ -E -dM - References: Message-ID: Am 2011-01-24 um 23:52 schrieb Chris Weisiger: > I've inherited a large codebase that is practically the definition > of "legacy", with all that entails. I've spent a lot of time > removing unused code, renaming variables, creating classes, moving > global variables to locals (let's stuff all our program state into a > single module and then just import that whenever we want to access > it!), and so on, and now I want to start cleaning up the dependency > chains between different modules. > > There's several places where I've had to move an import statement > from being at the top of the module to being inside a function right > before it's used, to prevent circular dependencies from causing > imports to fail at program start. I wouldn't be surprised if I've > rendered many of these imports moot, but short of a fair amount of > painful grepping across ~20k lines of Python, I don't know of an > easy way to find them. > > Is there a tool that examines your actual and apparent dependencies? > I know there are programs that will generate dependency graphs, but > for those there's little difference between a tight coupling and a > single import statement that isn't actually needed. I use Eclipse/Aptana with PyDev, and if you manage to setup that monster, it shows unused imports (as well as unused variables etc.) quite nicely. (It can't cope with dynamical class wizardry, like in dabo, and I don't understand why it fails to find Django classes.) Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From Chris.Barker at noaa.gov Thu Jan 27 18:47:12 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 27 Jan 2011 09:47:12 -0800 Subject: [Pythonmac-SIG] C++ ABI 1002/102 incompatibility with wxPython In-Reply-To: <387145.4162.qm@web34402.mail.mud.yahoo.com> References: <4D3E95F8.5000101@etrix.com.au> <4D3F0301.3030209@noaa.gov> <4D3F306E.7080005@gmail.com> <4D3F4DB8.4020107@noaa.gov> <387145.4162.qm@web34402.mail.mud.yahoo.com> Message-ID: <4D41AFA0.90608@noaa.gov> On 1/26/11 7:06 AM, Lou Pecora wrote: > Any idea how to see what ABI version a given binary was compiled against? > I thought otool could do that. Try, > > otool -L ABI > > Do a > > man otool > > to see more. > Let me know if that works. nope, can't find anything about ABI version in the man pages, and I've tried all the switches that looked like they might have something. You'd think it would, though -- maybe I missed something. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From Chris.Barker at noaa.gov Thu Jan 27 18:50:26 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 27 Jan 2011 09:50:26 -0800 Subject: [Pythonmac-SIG] Determining if I need an import In-Reply-To: References: Message-ID: <4D41B062.5050606@noaa.gov> On 1/27/11 3:48 AM, Henning Hraban Ramm wrote: > Am 2011-01-24 um 23:52 schrieb Chris Weisiger: > I use Eclipse/Aptana with PyDev, and if you manage to setup that > monster, it shows unused imports (as well as unused variables etc.) > quite nicely. pychecker is worth a try, too: http://pychecker.sourceforge.net/ It'll likely find other stuff you want to know about as well. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From nad at acm.org Thu Jan 27 20:18:15 2011 From: nad at acm.org (Ned Deily) Date: Thu, 27 Jan 2011 11:18:15 -0800 Subject: [Pythonmac-SIG] How to get a Mac OS X version of Tcl/Tk rather than X11 version. References: <960836.10021.qm@web34405.mail.mud.yahoo.com> Message-ID: In article <960836.10021.qm at web34405.mail.mud.yahoo.com>, Lou Pecora wrote: > I have an installation of Python 2.6.4 on my MacBook Pro (OS X 10.6) that by > default uses X11 windows and dialogs rather than the Mac version of those GUI > items. In my googling and exchanges on other support groups I've come down > to > the problem may be with the Tcl/Tk installation using the "generic" X11 GUI > rather than the Mac version. Does anyone know how I can change that in the > Tk > part of the python framework? Which Tcl/Tk is used by Python depends on the way the Python you are using was built. The Apple-supplied Pythons in OS X and the Pythons installed from python.org and some 3rd-party suppliers (like ActiveState Python) use the "native" Aqua Tk, the most common versions being those shipped by Apple with OS X or the ActiveState Tcl/Tk distribution of OS X. Python 2.6.4 is not the version shipped by Apple in 10.6 so you must have built or installed another version. `which python` will tell you where it is installed. If the path starts with "/opt/local/" chances are you using a MacPorts Python; currently the MacPorts Python uses a MacPorts Tk port which by default is built with X11, rather than as a Aqua Tk. The MacPorts Tk port does have a "+quartz" variant which is supposed to build Aqua Tk but it currently does not work on 10.6. To get back to using an Aqua Tk, you can install the most recent 2.6 Python (2.6.6) from python.org: http://www.python.org/download/releases/2.6.6/ It uses Aqua Tk 8.4 and is 32-bit only. Note that 2.7.1 and 3.1.3 (soon to be 3.2) are the current versions of Python. -- Ned Deily, nad at acm.org From lou_boog2000 at yahoo.com Thu Jan 27 21:41:10 2011 From: lou_boog2000 at yahoo.com (Lou Pecora) Date: Thu, 27 Jan 2011 12:41:10 -0800 (PST) Subject: [Pythonmac-SIG] How to get a Mac OS X version of Tcl/Tk rather than X11 version. In-Reply-To: References: <960836.10021.qm@web34405.mail.mud.yahoo.com> Message-ID: <665033.65503.qm@web34401.mail.mud.yahoo.com> ----- Original Message ---- From: Ned Deily To: pythonmac-sig at python.org Sent: Thu, January 27, 2011 2:18:15 PM Subject: Re: [Pythonmac-SIG] How to get a Mac OS X version of Tcl/Tk rather than X11 version. In article <960836.10021.qm at web34405.mail.mud.yahoo.com>, Lou Pecora wrote: > I have an installation of Python 2.6.4 on my MacBook Pro (OS X 10.6) that by > default uses X11 windows and dialogs rather than the Mac version of those GUI > items. In my googling and exchanges on other support groups I've come down > to > the problem may be with the Tcl/Tk installation using the "generic" X11 GUI > rather than the Mac version. Does anyone know how I can change that in the > Tk > part of the python framework? Which Tcl/Tk is used by Python depends on the way the Python you are using was built. The Apple-supplied Pythons in OS X and the Pythons installed from python.org and some 3rd-party suppliers (like ActiveState Python) use the "native" Aqua Tk, the most common versions being those shipped by Apple with OS X or the ActiveState Tcl/Tk distribution of OS X. Python 2.6.4 is not the version shipped by Apple in 10.6 so you must have built or installed another version. `which python` will tell you where it is installed. If the path starts with "/opt/local/" chances are you using a MacPorts Python; currently the MacPorts Python uses a MacPorts Tk port which by default is built with X11, rather than as a Aqua Tk. The MacPorts Tk port does have a "+quartz" variant which is supposed to build Aqua Tk but it currently does not work on 10.6. To get back to using an Aqua Tk, you can install the most recent 2.6 Python (2.6.6) from python.org: http://www.python.org/download/releases/2.6.6/ It uses Aqua Tk 8.4 and is 32-bit only. Note that 2.7.1 and 3.1.3 (soon to be 3.2) are the current versions of Python. -- Ned Deily, Thanks, Ned. I found the solution to my particular problem. You are right. I'm using the SAGE package which includes a full supply of python (numpy, scipy, Cython, etc.etc.). SAGE builds against the Apple Tcl/Tk Frameworks in /System/Library/Frameworks *unless* there's another Tcl/Tk Framework in /Library/Frameworks. I installed such a framework before running the SAGE install. That's where SAGE python picked up the X11 GUI instead of the Aqua GUI in Tk calls. Solution: Remove the /Library/Frameworks Tcl and Tk versions. Then SAGE will build against the Apple Tcl and Tk frameworks. And you see Tk dialogs and Windows in Aqua. I got the hint from some helpful fellow to run otool -L _tkinter.so on the _tkinter.so in down in the python /lib-dynload folder. Doing that in Apple python and SAGE python pointed to different Tcl/Tk frameworks and helped solve the problem. I posted this separately on this list, too. -- Lou Pecora, my views are my own. From muthonimasinde at gmail.com Sat Jan 29 14:01:40 2011 From: muthonimasinde at gmail.com (Muthoni Masinde) Date: Sat, 29 Jan 2011 16:01:40 +0300 Subject: [Pythonmac-SIG] RESOVING ImportError: No module named pygtk Message-ID: Hello there, I am trying to run a python program on my Mac OS X Version 10.5.8. The program makes use of the pygtk module. I successfully downloaded the module (pygtk) and on trying to install it using the "python setup.py install', I got a new error: ImportError: No module named dsextras I have tried in vain to look for the latter module(dsextras)... any one with some hint? Thank you in advance, Muthoni -------------- next part -------------- An HTML attachment was scrubbed... URL: From fandekasp at gmail.com Sun Jan 30 13:08:02 2011 From: fandekasp at gmail.com (Fandekasp) Date: Sun, 30 Jan 2011 12:08:02 +0000 Subject: [Pythonmac-SIG] [py-appscript] is System Events sleeping ? Message-ID: Hello, I'm a new user of appscript, and I can't find a way to know when my computer is sleeping or not. with : > from appscript import * app("System Events").sleep() I can force my system to sleep, but what I would like is to know when my system is going to sleep, to launch some routines behind (like programming an alarm to ring after 6 hours). I searched for an argument who could tell me this, but didn't find any. Is it at least possible ? Thank you very much for your help Best regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From amorris at mistermorris.com Sun Jan 30 15:49:23 2011 From: amorris at mistermorris.com (Adam Morris) Date: Sun, 30 Jan 2011 21:49:23 +0700 Subject: [Pythonmac-SIG] [py-appscript] is System Events sleeping ? In-Reply-To: References: Message-ID: Hi there, > I can force my system to sleep, but what I would like is to know when my > system is going to sleep, to launch some routines behind (like programming > an alarm to ring after 6 hours). I'm pretty sure not. Applescript doesn't let you register callbacks within the system, and even if you did something with a poll (endless repeat loop), the repeat loop itself would prevent it from sleeping in the first place. From fandekasp at gmail.com Sun Jan 30 16:12:39 2011 From: fandekasp at gmail.com (Fandekasp) Date: Sun, 30 Jan 2011 15:12:39 +0000 Subject: [Pythonmac-SIG] [py-appscript] is System Events sleeping ? In-Reply-To: References: Message-ID: Ok so the only solution for me is to map a sleep key which will call my program and plan some tasks (threading.Timer), and my program will force my system to sleep after that. Thank you Adam for your answer ! On 30 January 2011 14:49, Adam Morris wrote: > Hi there, > > > I can force my system to sleep, but what I would like is to know when my > > system is going to sleep, to launch some routines behind (like > programming > > an alarm to ring after 6 hours). > > I'm pretty sure not. > > Applescript doesn't let you register callbacks within the system, and > even if you did something with a poll (endless repeat loop), the > repeat loop itself would prevent it from sleeping in the first place. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From catena.duscio at hotmail.com Sun Jan 30 21:14:52 2011 From: catena.duscio at hotmail.com (Catena Duscio) Date: Sun, 30 Jan 2011 15:14:52 -0500 Subject: [Pythonmac-SIG] IDLE not working Message-ID: to whom this may concern, I have downloaded python 3.1 many times in the last coupe of days and each time I can not get the IDLE to open. From nad at acm.org Mon Jan 31 01:10:41 2011 From: nad at acm.org (Ned Deily) Date: Sun, 30 Jan 2011 16:10:41 -0800 Subject: [Pythonmac-SIG] IDLE not working References: Message-ID: In article , Catena Duscio wrote: > I have downloaded python 3.1 many times in the last coupe of days and each > time I can not get the IDLE to open. If you have downloaded Python 3.1.3 from the python.org website, try launching IDLE from a terminal shell window instead of double-clicking. In the shell, type: /Library/Frameworks/Python.framework/Versions/3.1/bin/idle3.1 If it fails, there should be a traceback printed which may give a clue as to the problem. If it does not, then quit IDLE and launch by double-clicking on IDLE.app in the Finder. You will then need to look in the system.log to see any error messages if IDLE fails to launch. The Console.app in /Applications/Utilities makes that easy to do. One recently reported problem with IDLE 3.x is that it can crash if its Recent Files list contains files with non-ascii characters in their path names. That can happen if you were using IDLE 2.x with such files, where this is no problem. A workaround is to simply delete the recent file list before launching IDLE 3.x: rm ~/.idlerc/recent-files.lst The problem and a fix for it is here: http://bugs.python.org/issue10974 -- Ned Deily, nad at acm.org