Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
978 views
in Technique[技术] by (71.8m points)

python - Symbol not found: Referenced from: Expected in: flat namespace | macOS Big Sur

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...