执行命令:
./pip3 install opencv-python
如下:
(base) zx@zxdeMacBook-Air anaconda3 % cd bin
(base) zx@zxdeMacBook-Air bin % ./pip3 install opencv-python
Collecting opencv-python
Downloading opencv_python-4.5.5.62-cp36-abi3-macosx_10_15_x86_64.whl (46.0 MB)
|████████████████████████████████| 46.0 MB 103 kB/s
Requirement already satisfied: numpy>=1.17.3 in /Users/zx/opt/anaconda3/lib/python3.9/site-packages (from opencv-python) (1.20.3)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.5.5.62
(base) zx@zxdeMacBook-Air bin % pwd
/Users/zx/opt/anaconda3/bin
安装好后,Pycharm中import cv2就可以正常使用了。