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.

Title: find_library on macOS Big Sur
Type: behavior Stage: resolved
Components: ctypes, macOS Versions: Python 3.10, Python 3.9, Python 3.8, Python 3.7, Python 3.6
Status: closed Resolution: duplicate
Dependencies: Superseder: Support macOS 11 and Apple Silicon Macs
View: 41100
Assigned To: Nosy List: ned.deily, python-dev, ronaldoussoren, sumanthratna
Priority: normal Keywords: patch

Created on 2020-07-01 02:10 by sumanthratna, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 21250 closed python-dev, 2020-07-01 02:16
Messages (3)
msg372728 - (view) Author: Sumanth Ratna (sumanthratna) * Date: 2020-07-01 02:10
The following all return None on macOS Big Sur, but return a valid path (str) on macOS Catalina:

python3.6 -c "from ctypes import util; print(util.find_library('objc'))"
python3.7 -c "from ctypes import util; print(util.find_library('objc'))"
python3.8 -c "from ctypes import util; print(util.find_library('objc'))"

The solution I'm thinking of is using platform.mac_ver() in ctypes.util.find_library to see if the macOS version is either 10.16 or 11.0; if so, use an alternative method to locate the path of the library somehow—else, use the current functionality. I'm hoping that looking in /System/Library/Frameworks/ is enough. 

From the macOS Big Sur release notes (

> New in macOS Big Sur 11 beta, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to `dlopen()` the path, which will correctly check for the library in the cache. (62986286)

Related links:
- (this is a build issue, but is related I think)

This is my first issue in Python; sorry in advance if I've made a mistake anywhere.
msg372734 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2020-07-01 07:38
We're tracking macOS 11 changes in Issue41100. That issue has a PRs from Apple for, amongst others, this issue.
msg372754 - (view) Author: Sumanth Ratna (sumanthratna) * Date: 2020-07-01 14:10
I see; thanks for letting me know! I saw Issue41100 but I had assumed that it was only for build issues :)

Should I close this issue?
Date User Action Args
2022-04-11 14:59:33adminsetgithub: 85351
2020-07-01 16:27:01ned.deilysetstatus: open -> closed
resolution: duplicate
stage: patch review -> resolved
2020-07-01 14:10:36sumanthratnasetmessages: + msg372754
2020-07-01 07:38:29ronaldoussorensetversions: + Python 3.9, Python 3.10
nosy: + ned.deily, ronaldoussoren

messages: + msg372734

components: + macOS
superseder: Support macOS 11 and Apple Silicon Macs
2020-07-01 02:16:14python-devsetkeywords: + patch
nosy: + python-dev

pull_requests: + pull_request20400
stage: patch review
2020-07-01 02:10:57sumanthratnacreate