[Pythonmac-SIG] [newbie] install PyObjc under EPD Python ?

Ned Deily nad at acm.org
Sun Dec 20 05:28:35 CET 2009


In article <D87DFA01-56F8-4E42-BD4B-AF4184AE7F94 at lumen.nu>,
 Joost Rekveld <lists at lumen.nu> wrote:
> The problem with MacPorts is that it installs everything around its own 
> Python25, which is again in a different place and I don't know how to 
> persuade it to install PyObjc where I want it.

You don't.  A Python package, particularly one that contains C 
extensions, should only be used with the Python instance which it was 
built with and installed into.  There can be major differences in the 
build options between Python instances even at the same release level.  
So if you install a MacPorts PyObjC, you use the MacPorts python, too.  
 
> Independently I found this page:
> 
> <http://forums.macrumors.com/archive/index.php/t-377881.html>
> 
> and when I add this to my PythonPath:
> 
> /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyO
> bjC
> /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2
> app
>  
> it all seems to work: at least it seems now that I can import objc, AppKit, 
> QTKit
> tonight i'll be able to see whether it really works.
> 
> This workaround seems a bit dodgy to me, but it works ?

It's bad practice to follow.  In the absence of compatibility 
guarantees, the only safe approach is to install any missing modules you 
need into each Python instance where you need them.  And, while it is 
fine to install additional packages to the Apple-supplied pythons (these 
additional site packages are placed in /Library/Python), one should 
never try to remove or delete the Apple-supplied files (in /usr/bin and 
/System/Library).  They are part of OS X and managed by Apple.

-- 
 Ned Deily,
 nad at acm.org



More information about the Pythonmac-SIG mailing list