-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for Python 2 framework support on macOS 12.3
virtualenv's trick of adding a symlink to the Python dylib -- `/path/to/Python.framework/Versions/2.7/Python` -- in the virtualenv root and rewriting the dependent dylib list of `<virtualenv>/bin/python` with the path of this symlink no longer works in 12.3. As of macOS 12.3, when <https://github.com/python/cpython/blob/v2.7.18/Modules/getpath.c> computes `sys.prefix`, it ends up resolving the symlink. The result is that `sys.prefix` points to the Python framework, e.g. `/path/to/Python.framework/Versions/2.7` instead of at the virtualenv root. To mitigate this, add a _copy_ of the Python dylib into the virtualenv instead of a symlink. To placate code signing, add a symlink to the `Resources` dir so the `Info.plist` file is accessible.
- Loading branch information
1 parent
1aa302f
commit 408c3bb
Showing
2 changed files
with
27 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix for creating virtualenvs from a Python 2.7 framework on macOS 12.3 - by :user:`nickhutchinson`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters