[Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra)

Ronald Oussoren ronaldoussoren at me.com
Tue Dec 13 06:20:09 EST 2016


> On 14 Sep 2016, at 00:28, Glyph Lefkowitz <glyph at twistedmatrix.com> wrote:
> 
> 
>> On Sep 13, 2016, at 3:05 PM, Andrew Jaffe <a.h.jaffe at gmail.com <mailto:a.h.jaffe at gmail.com>> wrote:
>> 
>> But this is the framework (non-apple!) build!…
> 
> "framework build" refers to the way that Python is built.  Apple's python, Python.org <http://python.org/>'s python, and Homebrew's python are all framework builds.  So, to be clear: this is python.org <http://python.org/> python?
> 
>> And, again: why isn’t everyone seeing this all the time? (And why didn’t I see it before?)
> 
> There's probably a .pth file somewhere that is stuffing Extras on your sys.path.  easy_install (especially older versions) is notorious for creating such things in ways that are hard to inspect for.  My usual recommendation at this point is to blow away _everything_ in /Library/Python, ~/Library/Python, ~/.local/lib/python*, and /Library/Frameworks/Python.framework and then reinstall from scratch.  (Thanks to SIP you don't need to blow away anything in /System anymore; hooray!)

It should be enough to remove “/Library/Python” from the list of site packages in the non-system install of Python, it is added at the end of setsitepackages() in site.py. This should be done before running any code (particularly the ensurepip tool).  That would remove the directory containing the Extras.pth on 10.12, and hence remove the conflict between Apple stuff and user provided stuff.   Doing this with the python.org installer requires some care, as it will by default run ensurepip during the installation (but this can be turned off).

According to issue 28440 /Library/Python/2.7/site-packages will no longer be treated as a site-packages directory in a future release of 2.7.

Ronald

> -glyph
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> https://mail.python.org/mailman/listinfo/pythonmac-sig
> unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20161213/510947cb/attachment-0001.html>


More information about the Pythonmac-SIG mailing list