I've been trying import a Module using:
import pyexiv2
which yields an error
Aruns-MacBook-Air:scripts arun$ python3 99-new-camera.py crop_field
Traceback (most recent call last):
File "99-new-camera.py", line 7, in <module>
import pyexiv2 # dnf install python3-exiv2 (py3exiv2)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyexiv2/__init__.py", line 60, in <module>
import libexiv2python
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/libexiv2python.cpython-37m-darwin.so, 2): Symbol not found: _PyCMethod_New
Referenced from: /usr/local/opt/boost-python3/lib/libboost_python39.dylib
Expected in: flat namespace
in /usr/local/opt/boost-python3/lib/libboost_python39.dylib
I already have all the dependencies installed, I don't see why this error is being raised. I'm running Python 3.7 on macOS Big Sur. Are there any workarounds for this issue?
I believe I've found a solution to the problem from this post which suggests a fix by adding a linker flag -lboost-python3
. How do I add a linker flag and fix this issue?
question from:
https://stackoverflow.com/questions/65936143/symbol-not-found-referenced-from-expected-in-flat-namespace-macos-big-sur 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…