[Pythonmac-SIG] Python 2.7b2 framework install

Michiel de Hoon mjldehoon at yahoo.com
Tue Jun 1 12:35:17 CEST 2010


I tried this again on Mac OS X 10.5 and found that the Python inside Python.app works as a framework, but python and pythonw do not:

$ /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python 
Python 2.7b2+ (trunk:81635, Jun  1 2010, 20:39:42) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MacOS
>>> MacOS.WMAvailable()
True
>>> ^D


$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin//python

$ python
Python 2.7b2+ (trunk:81635, Jun  1 2010, 20:39:42) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MacOS
>>> MacOS.WMAvailable()
False
>>> ^D

$ ls -l /usr/local/bin/python
lrwxr-xr-x  1 root  wheel  60 Jun  1 20:42 /usr/local/bin/python -> /Library/Frameworks/Python.framework/Versions/2.7/bin/python

$ /usr/local/bin/python
Python 2.7b2+ (trunk:81635, Jun  1 2010, 20:39:42) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MacOS
>>> MacOS.WMAvailable()
False
>>> ^D

If I move python2.7 from /Library/Frameworks/Python.framework/Versions/2.7/bin to /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python, then I can run python2.7 as a framework.

So I guess what is happening is that because of the use of posix_spawn in pythonw in Python 2.7, the executable is in /Library/Frameworks/Python.framework/Versions/2.7/bin, instead of inside Python.app, so it doesn't interact appropriately with the window manager. Python 2.6 uses execve in pythonw, so /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python is the executable, and behaves as a framework.

--Michiel.

--- On Sun, 5/30/10, Ronald Oussoren <ronaldoussoren at mac.com> wrote:

> From: Ronald Oussoren <ronaldoussoren at mac.com>
> Subject: Re: [Pythonmac-SIG] Python 2.7b2 framework install
> To: "Michiel de Hoon" <mjldehoon at yahoo.com>
> Cc: pythonmac-sig at python.org
> Date: Sunday, May 30, 2010, 11:59 AM
> 
> On 30 May, 2010, at 4:00, Michiel de Hoon wrote:
> 
> > Hi everybody,
> > 
> > When I try to install Python as a framework:
> > 
> > ./configure --enable-framework
> > make
> > make install
> > 
> > then Python gets installed under
> /Library/Frameworks/Python.framework/Versions/2.7, but it
> doesn't seem to function as a framework:
> > 
> >>>> import MacOS
> >>>> MacOS.WMAvailable()
> > False
> 
> Odd. This works for me using a universal build.
> 
> 
> >>>> 
> > 
> > Python 2.6.5 installed as a framework returns True
> here.
> > 
> > With Python 2.7b2, my extension module (the MacOSX
> backend for matplotlib) doesn't interact correctly with the
> window manager; it works fine with Python 2.6.5.
> > 
> > Did anything change in the installation of frameworks
> between Python 2.6.5 and 2.7b2?
> 
> The python/pythonw command's got replaced by a slightly
> more useful implementation. 
> 
> Which version of OSX are you on?
> 
> Ronald
> > 
> > Thanks,
> > --Michiel.
> > 
> > 
> > 
> > _______________________________________________
> > 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
> 
> 


      


More information about the Pythonmac-SIG mailing list