avatarify-python
avatarify-python copied to clipboard
Error "cam_fomm.py" import cv2 on Mac
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.
Hi, @Paulex-Git! What version of Mac OSX do you have? If Catalina this link can help.
@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
@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
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
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.
How can I resolve the same error for windows?
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