I am new to python, I was trying to import some libraries.
import sys
import cv2
import face_recognition
import pickle
But, I get this error in VS Code. When I run the same thing on PyCharm CE, It doesn't even recognize the module cv2. I know, I have installed opencv-python, but the issue still persists.
Traceback (most recent call last):
File "/Users/vedantamohapatra/Downloads/Face Detection/embedding.py", line 3, in <module>
import face_recognition
File "/opt/homebrew/lib/python3.9/site-packages/face_recognition/__init__.py", line 7, in <module>
from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
File "/opt/homebrew/lib/python3.9/site-packages/face_recognition/api.py", line 4, in <module>
import dlib
File "/opt/homebrew/lib/python3.9/site-packages/dlib/__init__.py", line 19, in <module>
from _dlib_pybind11 import *
ImportError: dlopen(/opt/homebrew/lib/python3.9/site-packages/_dlib_pybind11.cpython-39-darwin.so, 0x0002): tried: '/opt/homebrew/lib/python3.9/site-packages/_dlib_pybind11.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/_dlib_pybind11.cpython-39-darwin.so' (no such file), '/usr/lib/_dlib_pybind11.cpython-39-darwin.so' (no such file)
I tried searching for this error but didn't find any working solution. Is this something which can't be solved now due to the architecture? As I got a (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) error in there too. I am using M1 Mac Monterey 12.1.
On a side node, If this issue is unresolved, can anyone please point out any alternative for this, like would Google Colab be fine?