Default python path and System Integrity Protection block successful package installs with projects like pip

Originator:arubdesu
Number:rdar://23234321 Date Originated:October 23, 2015
Status:Open Resolved:
Product:OS X Product Version:10.11+
Classification:Other Bug Reproducible:Always
 
Summary:
Default python path and System Integrity Protection block successful package installs with projects like pip

Steps to Reproduce:
1. install pip, e.g. with easy_install pip
2. install any common python package with 'sudo pip', so it's available system-wide (django, aws-cli, etc.)

Expected Results:
Successful installation

Actual Results:
OSError: [Errno 1] Operation not permitted: '/tmp/pip-Tz8iWw-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

Regression:
10.11+ computers with SIP enabled

Notes:
Because six ships with the system, and almost every popular python project uses it for forwards compatibility, pip tries to upgrade the version it finds first in the python path. Since SIP blocks this, it fails.
Any python dependencies system software has should be hard-coded, and the default path should look in /Library/Python/2.7/site-packages first in order.

Comments

Duped as 23235742 - Python/pip and SIP are colliding - dupe of rdar://problem/23234321

By ciderconsulting at Oct. 23, 2015, 4:16 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!