avatarify-python icon indicating copy to clipboard operation
avatarify-python copied to clipboard

Error "cam_fomm.py" import cv2 on Mac

Open Paulex-Git opened this issue 4 years ago • 7 comments

When i run on Mac, i get this errors:

Traceback (most recent call last): File "cam_fomm.py", line 11, in <module>

import cv2

File "/Users/---/opt/miniconda3/envs/avatarify/lib/python3.7/site-packages/cv2/__init__.py", line 5, in <module>

from .cv2 import *

ImportError: dlopen(/Users/---/opt/miniconda3/envs/avatarify/lib/python3.7/site-packages/cv2/cv2.cpython-37m-darwin.so, 2): Symbol not found: _inflateValidate Referenced from: /Users/---/opt/miniconda3/envs/avatarify/lib/python3.7/site-packages/cv2/.dylibs/libpng16.16.dylib (which was built for Mac OS X 10.13)

Expected in: /usr/lib/libz.1.dylib in /Users/---/opt/miniconda3/envs/avatarify/lib/python3.7/site-packages/cv2/.dylibs/libpng16.16.dylib Any help will be appreciated.

Paulex-Git avatar Apr 26 '20 09:04 Paulex-Git

Hi, @Paulex-Git! What version of Mac OSX do you have? If Catalina this link can help.

karfly avatar Apr 27 '20 09:04 karfly

@karfly I'm getting the same on OS Sierra 10.12.1. [[Can't update my OS at the moment for other programs.]] Any other resolution?

Traceback (most recent call last):

File "afy/cam_fomm.py", line 9, in <module>
  import cv2
File "/opt/miniconda3/envs/avatarify/lib/python3.7/site-packages/cv2/__init__.py", line 5, in <module>
  from .cv2 import *
ImportError: dlopen(/opt/miniconda3/envs/avatarify/lib/python3.7/site-packages/cv2/cv2.cpython-37m-darwin.so, 2): Symbol not found: _inflateValidate
Referenced from: /opt/miniconda3/envs/avatarify/lib/python3.7/site-packages/cv2/.dylibs/libpng16.16.dylib (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libz.1.dylib
in /opt/miniconda3/envs/avatarify/lib/python3.7/site-packages/cv2/.dylibs/libpng16.16.dylib

harpreets avatar Jun 05 '20 04:06 harpreets

@karfly OS Sierra 10.12.2 @harpreets The issue is that the opencv is newer and incompatible with Sierra 10.12, so you need to install a lower version 3.4.5.20 Run: pip install opencv-python==3.4.5.20 After that, open "requirements_client.txt" and change opencv-python==3.4.9.33 to opencv-python==3.4.5.20

Then re-run bash scripts/install_mac.sh

Paulex-Git avatar Jun 09 '20 18:06 Paulex-Git

I can confirm that this is a good enhancement: Infact, just change the "requirements_client.txt" value, the bash script will automatically install the indicated version, 3.4.5.20

bobvo23 avatar Jun 18 '20 04:06 bobvo23

Hi, @Paulex-Git! What version of Mac OSX do you have? If Catalina this link can help.

Upgrading to Catalina will resolve the issue. Though it could be a bit much to run the program. The numpy version change can resolve the issue.

bobvo23 avatar Jun 18 '20 05:06 bobvo23

How can I resolve the same error for windows?

joedicks911 avatar Oct 12 '23 18:10 joedicks911

What error... video or pic But here is a video I made for you all on YouTube...

Avatarify windows installation https://youtu.be/sylE-uIhNCw

SanPatrick01 avatar Oct 13 '23 05:10 SanPatrick01