Opened 4 years ago
Closed 3 years ago
#62475 closed defect (fixed)
py-pyobjc @7.1_0: Symbol not found: _ffi_find_closure_for_code_np
Reported by: | dsedivec | Owned by: | danchr (Dan Villiom Podlaski Christiansen) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.4 |
Keywords: | Cc: | dsavransky (Dmitry Savransky), DanielO (Daniel O'Connor), gallafent | |
Port: | py-pyobjc |
Description
I get the following error when trying to use PyObjC as bundled by MacPorts:
$ /opt/local/bin/python3.9 Python 3.9.2 (default, Mar 16 2021, 12:04:06) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import Cocoa Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/Cocoa/__init__.py", line 9, in <module> import AppKit File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/AppKit/__init__.py", line 10, in <module> import Foundation File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/Foundation/__init__.py", line 9, in <module> import CoreFoundation File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/CoreFoundation/__init__.py", line 9, in <module> import objc File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/objc/__init__.py", line 6, in <module> from . import _objc ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/objc/_objc.cpython-39-darwin.so, 2): Symbol not found: _ffi_find_closure_for_code_np Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/objc/_objc.cpython-39-darwin.so Expected in: flat namespace in /opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/objc/_objc.cpython-39-darwin.so
(Faster way to test this from your shell: `/opt/local/bin/python3.9 -c 'import Cocoa')
Test system is a freshly-reinstalled 2019 MBP (so x86_64 not M1) running macOS 11.2.3.
I got the same error when testing with Python 3.8 from MacPorts. Using Apple's /usr/bin/python3
to make a virtualenv and install PyObjC with pip works fine.
Change History (9)
comment:1 Changed 4 years ago by mf2k (Frank Schima)
Cc: | danchr@… removed |
---|---|
Owner: | set to danchr |
Status: | new → assigned |
comment:2 follow-up: 8 Changed 4 years ago by danchr (Dan Villiom Podlaski Christiansen)
comment:4 Changed 4 years ago by dsavransky (Dmitry Savransky)
comment:5 Changed 4 years ago by dsavransky (Dmitry Savransky)
Cc: | dsavransky added |
---|
comment:6 Changed 3 years ago by DanielO (Daniel O'Connor)
Cc: | DanielO added |
---|
comment:7 Changed 3 years ago by gallafent
Cc: | gallafent added |
---|
comment:8 Changed 3 years ago by DanielO (Daniel O'Connor)
Replying to danchr:
I've posted a pull request which should fix this:
https://github.com/macports/macports-ports/pull/10336
The underlying issue is that PyObjC does not work with the libffi included with MacPorts on Big Sur.
+1 for this pull request - works for me.
Perhaps even if this is not a perfect solution it can be used while a better one is being worked on?
comment:9 Changed 3 years ago by danchr (Dan Villiom Podlaski Christiansen)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I've posted a pull request which should fix this:
https://github.com/macports/macports-ports/pull/10336
The underlying issue is that PyObjC does not work with the libffi included with MacPorts on Big Sur.