This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2016年10月14日 13:09 by Marc.Culler, last changed 2022年04月11日 14:58 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| pipfails.patch | Marc.Culler, 2016年10月14日 13:08 | patch | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 5445 | merged | ned.deily, 2018年01月30日 09:52 | |
| Messages (8) | |||
|---|---|---|---|
| msg278649 - (view) | Author: Marc Culler (Marc.Culler) * | Date: 2016年10月14日 13:08 | |
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: /Library/Python/2.7/site-packages/Extras.pth The current version of site.py reads that .pth file, which results in sys.path containing the path: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python 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 site.py which adds these paths. |
|||
| msg278657 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2016年10月14日 16:54 | |
This also affects the -m ensurepip installation of pip itself: the pip install fails trying to upgrade the Apple-supplied version of setuptools. The behavior of adding the system Python's site-packages directory to the search path of all framework-build Pythons was deliberately added as a result of Issue4865. I think experience has shown this was not a good idea because of the coupling it introduced between separate Python installations and some third-party distributors of Python on OS X already patch this code out. It's currently only an issue for 2.7.x since Apple has not yet shipped versions of Python 3.x but the code should be removed there, too. |
|||
| msg279779 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2016年10月31日 11:26 | |
Another reason to remove this feature: installing python 2.7.12 using the installer on www.python.org breaks the system install of Python, likely because of this issue. I'm a bit sad that this feature has to go, but modern Python use (in particular virtualenv) has reduced the need for this feature. |
|||
| msg282272 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年12月03日 07:15 | |
New changeset a8a342b3fbc7 by Ned Deily in branch '2.7': Issue #28440: No longer add /Library/Python/site-packages, the Apple-supplied https://hg.python.org/cpython/rev/a8a342b3fbc7 |
|||
| msg282275 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2016年12月03日 07:21 | |
I've pushed the change to revert Issue4865 for the 2.7 branch for release with 2.7.13. I am leaving this open to push similar changes for 3.x branches in anticipation of Apple someday supplying system Python 3.x. It would also be good to see if the post-install script that runs ensurepip can be made to fail more noisily. |
|||
| msg311261 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2018年01月30日 10:14 | |
New changeset 763f094b1f0ce2a07768828e78afe9687e9ad3bb by Ned Deily in branch 'master': bpo-28440: Don't add /Library/Python/3.x/site-packages to sys.path (#5445) https://github.com/python/cpython/commit/763f094b1f0ce2a07768828e78afe9687e9ad3bb |
|||
| msg347833 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2019年07月13日 14:45 | |
In response to msg282272: That day has come, the beta for 10.15 contains Python 3.7.3. |
|||
| msg347840 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2019年07月13日 15:23 | |
> That day has come, the beta for 10.15 contains Python 3.7.3. Yay! FTR, 763f094b1f0ce2a07768828e78afe9687e9ad3bb was released in 3.7.0. The only reason I have left this issues open was that I also wanted to make sure that ensurepip failures in the post-install script do not fail silently. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:38 | admin | set | github: 72626 |
| 2019年07月13日 15:23:04 | ned.deily | set | messages: + msg347840 |
| 2019年07月13日 14:45:33 | ronaldoussoren | set | messages: + msg347833 |
| 2018年01月30日 10:14:14 | ned.deily | set | messages: + msg311261 |
| 2018年01月30日 09:52:41 | ned.deily | set | pull_requests: + pull_request5277 |
| 2016年12月03日 07:21:14 | ned.deily | set | priority: release blocker -> messages: + msg282275 versions: + Python 3.6, Python 3.7 |
| 2016年12月03日 07:15:15 | python-dev | set | nosy:
+ python-dev messages: + msg282272 |
| 2016年10月31日 11:26:02 | ronaldoussoren | set | messages: + msg279779 |
| 2016年10月14日 16:54:39 | ned.deily | set | priority: normal -> release blocker type: compile error -> assignee: ned.deily title: pip failures on macOS Sierra -> ensurepip and pip install failures on macOS Sierra with non-system Python 2.7.x nosy: + benjamin.peterson versions: + Python 2.7 messages: + msg278657 stage: patch review |
| 2016年10月14日 15:07:42 | r.david.murray | set | nosy:
+ ronaldoussoren, ned.deily components: + macOS |
| 2016年10月14日 13:09:00 | Marc.Culler | create | |