Title: Older Python builds are missing a required file on Big Sur
Type: crash Stage: resolved
Components: macOS Versions:
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: kamilturek, ned.deily, rhettinger, ronaldoussoren
Priority: normal Keywords:

Created on 2021-03-03 22:17 by rhettinger, last changed 2021-03-04 02:16 by ned.deily. This issue is now closed.

Messages (2)
msg388062 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2021-03-03 22:17
When I upgraded to Big Sur, all my older builds stopped working.

Do we have any known workarounds or can we publish updated builds that work?

Like a lot of consultants, I still have to help clients maintain older code.  Having a standard working build is essential.

$ python3.5
dyld: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.5/Resources/
  Reason: image not found
Abort trap: 6
msg388068 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2021-03-04 02:16
In summary, the Python binaries provided by macOS installers for already end-of-life versions of Python, like 3.5 and earlier 3.x versions, do not run on macOS 11 Big Sur and attempting to build these end-of-life versions from source will still not produce a fully-functional Python on macOS 11.

For others reading this, per PEP 478, Python 3.5.4 was the last "bugfix" release of 3.5 back in August 2017 and, per long-standing release policy, binary installers for Windows and macOS are no longer manufactured once a version transitions from its "bugfix" to its "security-fix-only" phase. Further, Python 3.5 reached "end-of-life" in September 2020, five years after its initial release. So, technically, Python 3.5 is totally unsupported by the CPython project.

That said, I did take a quick look at this. A web search found a number of other similar reports dating back to the initial release of Big Sur last year. The error message is definitely not very helpful (the CoreFoundation framework remains an essential piece of macOS) and I still have not seen a total explanation of what is going on but I'm 99% sure that the problem is that macOS installers for Python 3.5 were built for macOS 10.6+ and it is likely that there is some old cruft in the macOS CoreFoundation framework that Apple decided it no longer wanted to support as of macOS 11 (Apple did a lot of "housecleaning" in and leading up to Big Sur, one reason for the numbering change from 10.x to 11) and likely bumped a minimum supported version of CoreFoundation thus preventing executables that dynamically link to the older version to fail on launch, as in this case.

Note that the most recent macOS installers for releases since 3.5 (including the final bugfix/binary releases of 3.7.x, 3.6.x, and 2.7.x) were built for at least macOS 10.9+ and do not exhibit this problem on macOS 11 Big Sur. So it's only an issue for 3.5 and earlier 3.x versions of the installers, all of which have reached end-of-life.

I'm not aware of any way practical way to workaround this problem and make those installer binaries load on Big Sur. Clearly, the best longer-term solution is to upgrade to a supported version (like 3.9.x).  But possible workarounds:
1. If 3.5.x is absolutely needed, there are third-party distributors that continue to support older versions of Python. In particular, the MacPorts project provides pre-built binaries of Python 3.5 (and other releases) that run on macOS 11 (and for older releases of macOS, too).
2. If the 3.5 is absolutely needed, don't upgrade to Big Sur or run MacOS 10.15 (or earlier) in a virtual machine.
3. Build from source on Big Sur.

But keep in mind that, with any of those workarounds, there still is the fundamental issue that there were a number of changes in Big Sur that affect Python; there are build changes needed and, even when those are overcome, some things just don't work correctly on Big Sur without fixes; distutils and ctypes find_library of a system library (see Issue41116), come to mind. At the moment, only Python 3.9.1 and later are fully supported on Big Sur.

Sorry I don't have a more positive answer.
Date User Action Args
2021-03-11 19:04:17ned.deilylinkissue43470 superseder
2021-03-11 19:02:24ned.deilylinkissue43469 superseder
2021-03-04 02:16:26ned.deilysetstatus: open -> closed
resolution: out of date
messages: + msg388068

stage: resolved
2021-03-03 22:42:16kamiltureksetnosy: + kamilturek
2021-03-03 22:17:03rhettingercreate