New submission from Marc Culler:

Changes made to /Library/Python on macOSX Sierra cause the --with-ensurepip 
compiler flag to fail, and lead to failures of pip after installing Python.

The new file that causes the problem on Sierra is:
The current version of reads that .pth file, which results in sys.path 
containing the path:
The latter directory (which is protected by SIP) contains many Python 2.7 
packages, including easy_install, setuptools, six, py2app, numpy, pylab and 
pyOpenSSL.  The effect of including this SIP-protected path in sys.path is 
this:  installing or upgrade a package in /Library/Frameworks/Python.framework 
which is also installed as an "Extra" in the 
/System/Frameworks/Python.framework will cause pip to attempt to delete the 
"old" package from its SIP-protected directory, leading to a "Permission 
Denied" exception and a failed install.

Given that Apple has now tied /Library/Python to the system Python in this way, 
thereby making a separate Python framework in /Library/Frameworks unusable, the 
natural solution to this problem would be to stop including any /Library/Python 
paths in sys.path.

I am attaching a patch that removes the block of code in which adds 
these paths.

files: pipfails.patch
keywords: patch
messages: 278649
nosy: Marc.Culler
priority: normal
severity: normal
status: open
title: pip failures on macOS Sierra
type: compile error
Added file:

Python tracker <>
Python-bugs-list mailing list

Reply via email to