Re: [Pythonmac-SIG] Python development on OSX

2011-01-21 Thread Christopher Barker

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/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-21 Thread Bill Janssen
Charles Hartman co...@conncoll.edu 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@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-21 Thread Charles Hartman
On Fri, Jan 21, 2011 at 1:40 PM, Bill Janssen jans...@parc.com wrote:

 Charles Hartman co...@conncoll.edu 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
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-20 Thread Christopher Barker

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 Id 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/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-20 Thread Chris Weisiger
On Thu, Jan 20, 2011 at 8:56 AM, Christopher Barker
chris.bar...@noaa.govwrote:

 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
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-20 Thread Bill Janssen
Christopher Barker chris.bar...@noaa.gov 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 Id 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
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-20 Thread David Bolen
Chris Weisiger cweisi...@msg.ucsf.edu 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

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-20 Thread Adam Morris
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
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-20 Thread Bill Janssen
Adam Morris amor...@mistermorris.com 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
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-20 Thread Charles Hartman
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
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-19 Thread Andrew Jaffe

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


___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-19 Thread Christopher Barker

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/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-19 Thread Aahz
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 (a...@pythoncraft.com)   * http://www.pythoncraft.com/

The volume of a pizza of thickness 'a' and radius 'z' is
given by pi*z*z*a
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-19 Thread Charles Hartman
On Wed, Jan 19, 2011 at 2:10 PM, Christopher Barker chris.bar...@noaa.gov
 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
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-18 Thread Christopher Barker

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/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-18 Thread Bill Janssen
Christopher Barker chris.bar...@noaa.gov 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
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-17 Thread Daniel O'Donovan
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.odono...@gmail.com



___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-17 Thread Daniel O'Donovan
 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.odono...@gmail.com



___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-17 Thread Bill Janssen
Tony Cappellini cappy2...@gmail.com 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
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-17 Thread Tony Cappellini
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 jans...@parc.com wrote:

 Tony Cappellini cappy2...@gmail.com 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

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


[Pythonmac-SIG] Python development on OSX

2011-01-16 Thread Tony Cappellini
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
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-16 Thread Tony Cappellini
Thanks Dan

Fink? Which one is that?



On Sun, Jan 16, 2011 at 7:30 PM, Daniel O'Donovan dan.odono...@gmail.comwrote:

 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.odono...@gmail.com




___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-16 Thread Tony Cappellini
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?
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-16 Thread Ned Deily
In article 
aanlktimaqylndoskyvo5fnpfui4lwd61697nauutw...@mail.gmail.com,
 Tony Cappellini cappy2...@gmail.com wrote:
 On Sun, Jan 16, 2011 at 7:30 PM, Daniel O'Donovan 
 dan.odono...@gmail.comwrote:
  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,
 n...@acm.org

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Python development on OSX

2011-01-16 Thread Ned Deily
In article 
aanlktinytr56wgpjgh1vyxbsmbxv8trvp4zjwlhyz...@mail.gmail.com,
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