Opened 3 years ago

Closed 3 years ago

#63293 closed defect (fixed)

OpenCV Symbol not found: _av_dict_parse_string

Reported by: fmw42 (Fred Weinhaus) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: OpenCV, Python Cc:
Port: OpenCV

Description

I am trying to upgrade ports on my Mac OSX Sierra. I have upgraded them all. But now when I run my opencv @3.4.8_0+python37 (active) scripts, I am getting the following errors and do not know how to resolve.

Symbol not found: _av_dict_parse_string

The terminal listing is as follows:

python3.7 python_fit_ellipse.py
Traceback (most recent call last):
  File "python_fit_ellipse.py", line 1, in <module>
    import cv2
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/cv2/__init__.py", line 89, in <module>
    bootstrap()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/cv2/__init__.py", line 79, in bootstrap
    import cv2
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/cv2/python-3.7/cv2.cpython-37m-darwin.so, 2): Symbol not found: _av_dict_parse_string
  Referenced from: /opt/local/lib/libopencv_videoio.3.4.dylib
  Expected in: /opt/local/lib/libavcodec.58.dylib
 in /opt/local/lib/libopencv_videoio.3.4.dylib


I have the following installed (I was also trying to upgrade to python39 and opencv3 - don't know if this causes conflicts):

opencv @3.4.3_1+python37
opencv @3.4.8_0+python37 (active)
opencv3 @3.4.14_0
python37 @3.7.5_1
python37 @3.7.11_0 (active)
python38 @3.8.11_0 (active)
python39 @3.9.6_0 (active)

Help would be appreciated.

Change History (6)

comment:1 Changed 3 years ago by mascguy (Christopher Nielsen)

Owner: set to mascguy
Status: newassigned

comment:2 Changed 3 years ago by mascguy (Christopher Nielsen)

Port opencv is obsolete, and has been replaced by opencv3.

To fix the issue, first uninstall opencv. Then install py37-opencv3, which adds the Python bindings.

comment:3 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy@… removed

comment:4 Changed 3 years ago by mascguy (Christopher Nielsen)

More info:

With opencv3, you can now install Python bindings for multiple versions. So if you also want to add OpenCV Python bindings for Python 3.9, for example, install py39-opencv3.

comment:5 Changed 3 years ago by fmw42 (Fred Weinhaus)

Thanks. I was wondering what all those versions of pyXX-opencv3 were about. I have followed your instructions to uninstall opencv and reinstall both py37-opencv3 and py39-opencv3. My Python37 scripts now work. But they do not work when using Python39. I will post a new bug report (about Numpy).

I appreciate your quick response.

comment:6 Changed 3 years ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: assignedclosed

Glad we could resolve this issue for you!

Note: See TracTickets for help on using tickets.