Friday, 27 May 2022

Import error Symbol not found: _FSPathMakeRef

Can't import Quartz package. Every time I try it throws an error and the weird thing is the error disappears if I execute the same script with Sudo privileges (sudo python3 script.py). The problem started when I forcefully deleted the site-packages folder tried reinstalling python but didn't help.

Python version - 3.10.4

Mac version - Big Sur 11.6.5

>which python3
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3
>sudo which python3
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3

Output:

Traceback (most recent call last):
  File "/Users/user/unknown/test.py", line 1, in <module>
    import Quartz
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/Quartz/__init__.py", line 6, in <module>
    import AppKit
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/AppKit/__init__.py", line 10, in <module>
    import Foundation
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/Foundation/__init__.py", line 9, in <module>
    import CoreFoundation
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/CoreFoundation/__init__.py", line 9, in <module>
    import objc
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/objc/__init__.py", line 6, in <module>
    from . import _objc
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/objc/_objc.cpython-310-darwin.so, 2): Symbol not found: _FSPathMakeRef
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/objc/_objc.cpython-310-darwin.so
  Expected in: flat namespace
 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/objc/_objc.cpython-310-darwin.so


from Import error Symbol not found: _FSPathMakeRef

No comments:

Post a Comment