CPython2 support for macOS Big Sur
See original GitHub issueIssue
After creating a virtualenv with python2 from the Command Line Tools, running the python executable from that virtualenv fails:
% python virtualenv.pyz venv
created virtual environment CPython2.7.16.final.0-64 in 221ms
creator CPython2macOsFramework(dest=/Users/glandium/venv, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, wheel=bundle, setuptools=bundle, via=copy, app_data_dir=/Users/glandium/Library/Application Support/virtualenv)
added seed packages: pip==20.2.2, pip==20.2.4, setuptools==44.1.1, wheel==0.35.1
activators PythonActivator,CShellActivator,FishActivator,PowerShellActivator,BashActivator
% venv/bin/python
zsh: killed venv/bin/python
The problem comes from code signature not matching:
% codesign -v venv/bin/python
venv/bin/python: invalid Info.plist (plist or signature have been modified)
In architecture: x86_64
This doesn’t happen with python3.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:15 (6 by maintainers)
Top Results From Across the Web
macOS Big Sur is compatible with these computers
macOS Big Sur is compatible with these computers · MacBook Pro · MacBook Air · MacBook · iMac Pro · iMac · Mac...
Read more >Will macOS Big Sur remove the default Python installation for ...
No, on Apple Macs being shipped with Big Sur, Python 2 and Python 3 are both still included. $ which python /usr/bin/python $...
Read more >Upgrade macOS to continue receiving Microsoft 365 and ...
Note that new installs of Microsoft 365 for Mac also requires macOS Big Sur 11 or later. The October 2022 update (16.66) is...
Read more >macOS Big Sur - Wikipedia
macOS Big Sur (version 11) is the seventeenth major release of macOS, Apple Inc.'s operating system for Macintosh computers. It was announced at...
Read more >Support for macOS Catalina ended Oct 30; upgrade to Big Sur
You can install macOS Big Sur on any of these Mac models. If your Mac is not compatible, contact your local IT support...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
codesign -s - -f venv/bin/python works
, until it doesn’t and saysthe codesign_allocate helper tool cannot be found or used
, which I’m not sure under which circumstances it happens (although it seems to involve Rosetta), but it does:Another one:
But it doesn’t happen here:
So I guess if virtualenv itself would do the code signing, it would work™.
But the arm64e problem is unsolvable if virtualenv can’t be made to work with symbolic links. That said, after
codesign -s - -f venv/bin/python
succeeds,arch --x86_64 venv/bin/python
does work.It really sucks that the failure mode is that the process is killed rather than a more useful error message directly on the command line (instead of hidden in the console log).
The problem is virtualenv is editing the executable to change its dependencies to use
@executable_path
, invalidating the signature.