需求:在conda虚拟环境下安装opencv
pip install opencv-contrib-python安装失败,原因:下载安装包失败
pip install opencv-contrib-python -i https://pypi.tuna.tsinghua.edu.cn/simple安装失败,原因:下载安装包失败
使用pip install opencv-contrib-python -i https://pypi.tuna.tsinghua.edu.cn/simple,如果下载失败,但是卡住,提示:Running setup.py bdist_wheel for opencv-contrib-python … /,解决办法:pip安装opencv时卡住:Running setup.py bdist_wheel for opencv-python … /
解决办法:离线安装
- 下载安装包:复制网址https://pypi.tuna.tsinghua.edu.cn/packages/42/02/7b2fb0b81266aa3243dd8f392d48db1a206cc9a1856a14228e75c515616e/opencv-contrib-python-4.5.1.48.tar.gz到浏览器下载安装包
- 解压安装包:tar -zxvf opencv-contrib-python-4.5.1.48.tar.gz
- cd opencv-contrib-python-4.5.1.48
- python setup.py build
提示错误:ModuleNotFoundError: No module named ‘skbuild’
解决:pip install scikit-build
提示错误:
解决:编译OpenCV 以及 openc_contrib 提示缺少boostdesc_bgm.i文件出错的解决
- python setup.py install