Why can't I install OpenCV using pip on my Mac 12.0.1 (Monterey)? [duplicate]
When I tried install OpenCV using python pip, it showed this:
Remainder of file ignored
Requirement already satisfied: pip in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (20.3.4)
Collecting pip
Using cached pip-21.3.1-py3-********* (1.7 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.3.4
Uninstalling pip-20.3.4:
Successfully uninstalled pip-20.3.4
Successfully installed pip-21.3.1
*Mine*-MacBook-Air ~ % pip install cv2
Error processing line 1 of /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/********:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "<frozen **********bootstrap>", line 562, in module_from_spec
AttributeError: 'NoneType' object has no attribute 'loader'
Remainder of file ignored
Error processing line 1 of /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/*******************:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "<********.bootsrap>", line 562, in module_from_spec
AttributeError: 'NoneType' object has no attribute 'loader'
Remainder of file ignored
ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)
ERROR: No matching distribution found for cv2
I don't know why even if I try reinstalling python, nothing happens!
I am on Macbook Air 'version is given above' and even with python 10.1 (latest current version) nothing happens!
My pip version is also the latest one (you can find it in the above command).
Moreover this problem doesn't happen with some packages, it only happens with a few packages like open cv (cv2). Also, the command used by me to install it was '' PIP install cv2 ''. And please don't recommend me to upgrade my python version, cause I have tried it already and it showed the same thing!
Try pip install opencv-python
instead of pip install cv2