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.

Author Victor.Lazzarini
Recipients Victor.Lazzarini, ned.deily, ronaldoussoren
Date 2021-04-28.08:39:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619599189.53.0.161750349555.issue43964@roundup.psfhosted.org>
In-reply-to
Content
With Python 3.9.4 ctypes.CDLL does not appear to find framework libraries installed in /Library/Frameworks.

--- With Python 3.6.5:

victor@MacBook-Pro ~ % python3                                         
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 03:03:55) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> ctypes.CDLL('CUDA.framework/CUDA')
<CDLL 'CUDA.framework/CUDA', handle 102b044b0 at 0x102c9b9e8>
>>> 

--- With Python 3.9.4

victor@MacBook-Pro ~ % python3.9
Python 3.9.4 (v3.9.4:1f2e3088f3, Apr  4 2021, 12:32:44) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> ctypes.CDLL('CUDA.framework/CUDA')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(CUDA.framework/CUDA, 6): image not found
>>> 

This happens with all frameworks I have installed in /Library/Frameworks.
The full path seems to work OK:

>>> ctypes.CDLL('/Library/Frameworks/CUDA.framework/CUDA')
<CDLL '/Library/Frameworks/CUDA.framework/CUDA', handle 7fa358404180 at 0x7fa3580eeaf0>
>>> 

but that's suboptimal as in MacOS you might have frameworks installed elsewhere.
History
Date User Action Args
2021-04-28 08:39:49Victor.Lazzarinisetrecipients: + Victor.Lazzarini, ronaldoussoren, ned.deily
2021-04-28 08:39:49Victor.Lazzarinisetmessageid: <1619599189.53.0.161750349555.issue43964@roundup.psfhosted.org>
2021-04-28 08:39:49Victor.Lazzarinilinkissue43964 messages
2021-04-28 08:39:49Victor.Lazzarinicreate