<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 14 Sep 2009, at 16:05, <a href="mailto:pythonmac-sig-request@python.org">pythonmac-sig-request@python.org</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Send Pythonmac-SIG mailing list submissions to<br><span class="Apple-tab-span" style="white-space:pre">        </span><a href="mailto:pythonmac-sig@python.org">pythonmac-sig@python.org</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br><span class="Apple-tab-span" style="white-space:pre">        </span>http://mail.python.org/mailman/listinfo/pythonmac-sig<br>or, via email, send a message with subject or body 'help' to<br><span class="Apple-tab-span" style="white-space:pre">        </span>pythonmac-sig-request@python.org<br><br>You can reach the person managing the list at<br><span class="Apple-tab-span" style="white-space:pre">        </span>pythonmac-sig-owner@python.org<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of Pythonmac-SIG digest..."<br>Today's Topics:<br><br> &nbsp;&nbsp;1. Re: Pythonmac-SIG Digest, Vol 77, Issue 15 (Geert Dekkers)<br> &nbsp;&nbsp;2. Re: Pythonmac-SIG Digest, Vol 77, Issue 15 (Geert Dekkers)<br><br><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 0.5);"><b>From: </b></span><span style="font-family:'Helvetica'; font-size:medium;">Geert Dekkers &lt;geert@nznl.com&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 0.5);"><b>Date: </b></span><span style="font-family:'Helvetica'; font-size:medium;">14 September 2009 15:44:06 BST<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 0.5);"><b>To: </b></span><span style="font-family:'Helvetica'; font-size:medium;">pythonmac-sig@python.org<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 0.5);"><b>Subject: </b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>Re: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 77, Issue 15</b><br></span></div><br><br><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks David. As you suggested, I did a "file" on a python executable, and found that while you are quite correct that python is compiled a 2 way binary on a client 10.5, it's already a 4 way binary on the new xserve I have running 10.5 &nbsp;even though it's version 2.5. I also discovered that pyobjc will not automatically build as a 4 way bin against a 4 way build of python, and if you force it to, (by re-issuing a gcc command adding arch flags for 64 bit ppc and intel) it will complain about a missing architecture in *.o file.<div><br></div></div></blockquote>Mostly and I'm working from memory here to make PIL work effectively on 2.0 Python forward you need both numeric and IIRC ImageMagick and Jpeglib.</div><div>This has gone through several transitions s since I was actively using it.&nbsp;</div><div>It is worth installing and works very well particularly since you can get the PIL image in and out of numeric nicely.&nbsp;</div><div>Again from memory you need the third party jpeglib and not the OS X installed &nbsp;one.&nbsp;</div><div>HTH</div><div>Ed Hartley</div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I'll try doing a python 2.6 build next, and go from there.&nbsp;</div><div><br></div><div>Geert</div><div><br></div><div><br></div><div><div><div>On 14/09/2009, at 12:00 PM, <a href="mailto:pythonmac-sig-request@python.org">pythonmac-sig-request@python.org</a> wrote:</div><br class="Apple-interchange-newline"><blockquote typ="" e="cite" -span"="" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span style="font-family: Helvetica; font-size: medium; color: rgba(0, 0, 0, 0.496094); "><b><br class="Apple-interchange-newline">From:<span class="Apple-converted-space">&nbsp;</span></b></span><span style="font-family: Helvetica; font-size: medium; ">David Warde-Farley &lt;<a href="mailto:dwf@cs.toronto.edu">dwf@cs.toronto.edu</a>&gt;<br></span></div><div style="margin-t op: 0px; n-bottom: 0px; margin-left: 0px; "><span style="font-family: Helvetica; font-size: medium; color: rgba(0, 0, 0, 0.496094); "><b>Date:<span class="Apple-converted-space">&nbsp;</span></b></span><span style="font-family: Helvetica; font-size: medium; ">14 September 2009 9:48:02 AM<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span style="font-family: Helvetica; font-size: medium; color: rgba(0, 0, 0, 0.496094); "><b>To:<span class="Apple-converted-space">&nbsp;</span></b></span><span style="font-family: Helvetica; font-size: medium; ">Pythonmac-Sig 3 &lt;<a href="mailto:pythonmac-sig@python.org">pythonmac-sig@python.org</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span style="font-family: Helvetica; font-size: medium; color: rgba(0, 0, 0, 0.496094); "><b>Subject:<span class="Apple-converted-space">&nbsp;</span></b></span><span style="font-family: Helvet ica; fon [Pythonmac-SIG] django webapp using CoreGraphics complains about " wrong="" architecture"=""><br></span></div><br><br>On 13-Sep-09, at 10:58 AM, Geert Dekkers wrote:<br><br><blockquote type="cite">The problem is of course that I need to coax PyObjC to be run by 64 bit Apache. I read about the ability for PyObjC to run in 64-bit mode at<a href="http://pyobjc.sourceforge.net/documentation/pyobjc-core/news.html">http://pyobjc.sourceforge.net/documentation/pyobjc-core/news.html</a>. I don't know where to find out if my python is built with the required MACOSX_DEPLOYMENT_TARGET=10.5, but I would think so (as I'm running 10.5.8). (And you must realise I'm no hard-core programmer -- I learn as I go -- make heaps of mistakes doing so)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I did try a few tricks to get pyobjc to build as full fat binary (that is -arch ppc -arch i386 -arch ppc64 -arch x86_64) but so far no joy.<br></blockquote><blockquote type="ci te"><br> type="cite"&gt;(Actually one of the results was quite discerning: an example "ld warning: in build/temp.macosx-10.5-i386-2.5/Modules/_sortandmap.o, missing required architecture ppc64 in file<br></blockquote><blockquote type="cite">ld warning: in build/temp.macosx-10.5-i386-2.5/Modules/_sortandmap.o, missing required architecture x86_64 in file")<br></blockquote><br>Neither the Python 2.5 shipped with Leopard nor the Python 2.5 at Python.org are 64-bit builds/include 64 bit support. Try running 'file' on the python executable, you'll see only i386 and ppc.<br><br>You'll have to build a Python framework build from source as a 4-way universal (I'd recommend 2.6, as there is a script in the distribution for doing this on the Mac, and it might not even be possible on 2.5). Then you'll be able to build 4-way PyObjC (in fact, it should build that way automatically I think).<br><br><blockquote type="cite">And I'm wondering if this is at all necessary. Because -- why can Apache run PIL? ?? -- th full fat, but you can indeed do "import Image"<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">dekkers-2:~ geert$ file /Library/Python/2.5/site-packages/PIL/_imaging.so<br></blockquote><blockquote type="cite">/Library/Python/2.5/site-packages/PIL/_imaging.so: Mach-O universal binary with 2 architectures<br></blockquote><blockquote type="cite">/Library/Python/2.5/site-packages/PIL/_imaging.so (for architecture i386):<span class="Apple-tab-span" style="white-space: pre; ">        </span>Mach-O bundle i386<br></blockquote><blockquote type="cite">/Library/Python/2.5/site-packages/PIL/_imaging.so (for architecture ppc7400):<span class="Apple-tab-span" style="white-space: pre; ">        </span>Mach-O bundle ppc<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">But if you do "import _imaging", Apache gives you: "Could not import ccnet.views. Error was: dlopen(/Library/Python/2.5/site-packages/PIL/_imaging.so, 2): no suitable image fo und. Did 5/site-packages/PIL/_imaging.so: no matching architecture in universal wrapper"<br></blockquote><br><br>My best guess (as I've never poked around in the guts of PIL) is that there is a pure Python version that is slow-as-molasses and then a sped up C version which is used if possible (_imaging.so). PIL invoked from Apache will thus probably use the slow-as-molasses version as the import of _imaging will silently fail somewhere in the Python code but be caught by an exception handler.<br><br>David<br><br></blockquote></div><br></div></div> <br><br><br><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 0.5);"><b>From: </b></span><span style="font-family:'Helvetica'; font-size:medium;">Geert Dekkers &lt;<a href="mailto:geert@nznl.com">geert@nznl.com</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 0.5);"><b>Date: </b></span><span style="font-family:'Helvetica'; font-size:medium;">14 September 2009 16:05:13 BST<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 0.5);"><b>To: </b></span><span style="font-family:'Helvetica'; font-size:medium;"><a href="mailto:pythonmac-sig@python.org">pythonmac-sig@python.org</a><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 0.5);"><b>Subject: </b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>Re: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 77, Issue 15</b><br></span></div><br><br><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>UPDATE: Sorry, I was wrong. Client and server are equal in this respect. Look:</div><div><br></div><div><div>geert-dekkerss-macbook-pro:~ geert$ file /System/Library/Frameworks/Python.framework/Versions/2.5/Python&nbsp;</div><div>/System/Library/Frameworks/Python.framework/Versions/2.5/Python: Mach-O universal binary with 4 architectures</div><div>/System/Library/Frameworks/Python.framework/Versions/2.5/Python (for architecture ppc7400):<span class="Apple-tab-span" style="white-space:pre">        </span>Mach-O dynamically linked shared library ppc</div><div>/System/Library/Frameworks/Python.framework/Versions/2.5/Python (for architecture ppc64):<span class="Apple-tab-span" style="white-space:pre">        </span>Mach-O 64-bit dynamically linked shared library ppc64</div><div>/System/Library/Frameworks/Python.framework/Versions/2.5/Python (for architecture i386):<span class="Appl e-tab-sp e">        </span>Mach-O dynamically linked shared library i386</div><div>/System/Library/Frameworks/Python.framework/Versions/2.5/Python (for architecture x86_64):<span class="Apple-tab-span" style="white-space:pre">        </span>Mach-O 64-bit dynamically linked shared library x86_64</div><div>geert-dekkerss-macbook-pro:~ geert$ file /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5&nbsp;</div><div>/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5: Mach-O universal binary with 2 architectures</div><div>/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 (for architecture ppc7400):<span class="Apple-tab-span" style="white-space:pre">        </span>Mach-O executable ppc</div><div>/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 (for architecture i386):<span class="Apple-tab-span" style="white-space:pre">        </span>Mach-O executable i386</div><div>geert-dekkerss-macbook-pro:~ geert$ file /System/Library/Frameworks/Pyth on.frame hon&nbsp;</div><div>/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python: Mach-O universal binary with 2 architectures</div><div>/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python (for architecture ppc7400):<span class="Apple-tab-span" style="white-space:pre">        </span>Mach-O executable ppc</div><div>/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python (for architecture i386):<span class="Apple-tab-span" style="white-space:pre">        </span>Mach-O executable i386</div><div><br></div><div>Python -- with a capital P -- is 4 way, lowercase python 2 way. Would Python contain classes, called by python or python2.5???</div><div><br></div></div><div>Geert</div><div><br></div><div><br></div><div><div><div>On 14/09/2009, at 12:00 PM, <a href="mailto:pythonmac-sig-request@python.org">pythonmac-sig-request@python.org</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin -bottom: &gt;&lt;span style=" font-family:="" helvetica;="" font-size:="" medium;="" color:="" rgba(0,="" 0,="" 0.496094);=""><b><br class="Apple-interchange-newline">From:<span class="Apple-converted-space">&nbsp;</span></b><span style="font-family: Helvetica; font-size: medium; ">David Warde-Farley &lt;<a href="mailto:dwf@cs.toronto.edu">dwf@cs.toronto.edu</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span style="font-family: Helvetica; font-size: medium; color: rgba(0, 0, 0, 0.496094); "><b>Date:<span class="Apple-converted-space">&nbsp;</span></b></span><span style="font-family: Helvetica; font-size: medium; ">14 September 2009 9:48:02 AM<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span style="font-family: Helvetica; font-size: medium; color: rgba(0, 0, 0, 0.496094); "><b>To:<span class="Apple-converted-space">&nbsp;</span></b></span><span style="font-family: Helvetica; fon t-size:  &lt;&lt;a href=" mailto:pythonmac-sig@python.org"=""><a href="mailto:pythonmac-sig@python.org">pythonmac-sig@python.org</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span style="font-family: Helvetica; font-size: medium; color: rgba(0, 0, 0, 0.496094); "><b>Subject:<span class="Apple-converted-space">&nbsp;</span></b></span><span style="font-family: Helvetica; font-size: medium; "><b>Re: [Pythonmac-SIG] django webapp using CoreGraphics complains about "wrong architecture"</b><br></span></div><br><br>On 13-Sep-09, at 10:58 AM, Geert Dekkers wrote:<br><br><blockquote type="cite">The problem is of course that I need to coax PyObjC to be run by 64 bit Apache. I read about the ability for PyObjC to run in 64-bit mode at<a href="http://pyobjc.sourceforge.net/documentation/pyobjc-core/news.html">http://pyobjc.sourceforge.net/documentation/pyobjc-core/news.html</a>. I don't know where to find out if my python is built with the required MACOSX_DEPLOYMENT_TARGET=10.5 , but I nning 10.5.8). (And you must realise I'm no hard-core programmer -- I learn as I go -- make heaps of mistakes doing so)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I did try a few tricks to get pyobjc to build as full fat binary (that is -arch ppc -arch i386 -arch ppc64 -arch x86_64) but so far no joy.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">(Actually one of the results was quite discerning: an example "ld warning: in build/temp.macosx-10.5-i386-2.5/Modules/_sortandmap.o, missing required architecture ppc64 in file<br></blockquote><blockquote type="cite">ld warning: in build/temp.macosx-10.5-i386-2.5/Modules/_sortandmap.o, missing required architecture x86_64 in file")<br></blockquote><br>Neither the Python 2.5 shipped with Leopard nor the Python 2.5 at Python.org are 64-bit builds/include 64 bit support. Try running 'file' on the python executable, you'll see only i386 and ppc.<br><br>You'll have t o build from source as a 4-way universal (I'd recommend 2.6, as there is a script in the distribution for doing this on the Mac, and it might not even be possible on 2.5). Then you'll be able to build 4-way PyObjC (in fact, it should build that way automatically I think).<br><br><blockquote type="cite">And I'm wondering if this is at all necessary. Because -- why can Apache run PIL??? -- the .so files are also not full fat, but you can indeed do "import Image"<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">dekkers-2:~ geert$ file /Library/Python/2.5/site-packages/PIL/_imaging.so<br></blockquote><blockquote type="cite">/Library/Python/2.5/site-packages/PIL/_imaging.so: Mach-O universal binary with 2 architectures<br></blockquote><blockquote type="cite">/Library/Python/2.5/site-packages/PIL/_imaging.so (for architecture i386):<span class="Apple-tab-span" style="white-space: pre; ">        </span>Mach-O bundle i386<br></blockquote><blockquote type="cite">/Libr ary/Pyth _imaging.so (for architecture ppc7400):<span class="Apple-tab-span" style="white-space: pre; ">        </span>Mach-O bundle ppc<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">But if you do "import _imaging", Apache gives you: "Could not import ccnet.views. Error was: dlopen(/Library/Python/2.5/site-packages/PIL/_imaging.so, 2): no suitable image found. Did find: /Library/Python/2.5/site-packages/PIL/_imaging.so: no matching architecture in universal wrapper"<br></blockquote><br><br>My best guess (as I've never poked around in the guts of PIL) is that there is a pure Python version that is slow-as-molasses and then a sped up C version which is used if possible (_imaging.so). PIL invoked from Apache will thus probably use the slow-as-molasses version as the import of _imaging will silently fail somewhere in the Python code but be caught by an exception handler.<br><br>David<br><br></blockquote></div><br></div></div> <br><br></blockquote></div><br></body></html>