文章目录
- pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple 安装过程 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting opencv-python Downloading https://pypi.tuna.tsinghua.edu.cn/packages/48/c3/798bd7b8f78430f82ec0660b753106717e4e4bb8032ce56f77d8577cb24b/opencv_python-4.5.5.64-cp36-abi3-win_amd64.whl (35.4 MB) |████████████████████████████████| 35.4 MB 218 kB/s Collecting numpy>=1.13.3 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ea/bc/da526221bc111857c7ef39c3af670bbcf5e69c247b0d22e51986f6d0c5c2/numpy-1.19.5-cp36-cp36m-win_amd64.whl (13.2 MB) Installing collected packages: numpy, opencv-python Successfully installed numpy-1.19.5 opencv-python-4.5.5.64
- pip install opencv-contrib-python -i https://pypi.tuna.tsinghua.edu.cn/simple 安装过程 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting opencv-contrib-python Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2e/63/c02ffce9f182dd77fad7ee1f333a6a2aca1a5a2c14a683d30b5d2bd8d8db/opencv_contrib_python-4.5.5.64-cp36-abi3-win_amd64.whl (42.2 MB) |████████████████████████████████| 42.2 MB 311 kB/s Requirement already satisfied: numpy>=1.13.3 in c:usersyang.condaenvskivylibsite-packages (from opencv-contrib-python) (1.19.5) Installing collected packages: opencv-contrib-python Successfully installed opencv-contrib-python-4.5.5.64 此种方法安装后,import cv2 as cv后,代码可以正常运行
目录
- python安装opencv
- 先安装 opencv-python
- 安装opencv-contrib-python
- 总结
Anaconda 下创建一个python3.6的虚拟环境,进入虚拟环境开始安装:
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple
安装过程
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting opencv-python
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/48/c3/798bd7b8f78430f82ec0660b753106717e4e4bb8032ce56f77d8577cb24b/opencv_python-4.5.5.64-cp36-abi3-win_amd64.whl (35.4 MB)
|████████████████████████████████| 35.4 MB 218 kB/s
Collecting numpy>=1.13.3
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ea/bc/da526221bc111857c7ef39c3af670bbcf5e69c247b0d22e51986f6d0c5c2/numpy-1.19.5-cp36-cp36m-win_amd64.whl (13.2 MB)
Installing collected packages: numpy, opencv-python
Successfully installed numpy-1.19.5 opencv-python-4.5.5.64
pip install opencv-contrib-python -i https://pypi.tuna.tsinghua.edu.cn/simple
安装过程
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting opencv-contrib-python
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2e/63/c02ffce9f182dd77fad7ee1f333a6a2aca1a5a2c14a683d30b5d2bd8d8db/opencv_contrib_python-4.5.5.64-cp36-abi3-win_amd64.whl (42.2 MB)
|████████████████████████████████| 42.2 MB 311 kB/s
Requirement already satisfied: numpy>=1.13.3 in c:usersyang.condaenvskivylibsite-packages (from opencv-contrib-python) (1.19.5)
Installing collected packages: opencv-contrib-python
Successfully installed opencv-contrib-python-4.5.5.64
此种方法安装后,import cv2 as cv后,代码可以正常运行
以上为个人经验,希望能给大家一个参考,也希望大家多多支持风君子博客。
您可能感兴趣的文章:
- 从安装到应用全面掌握Python与OpenCV的配置与高级功能(最新推荐)
- Python安装OpenCV库超时失败解决
- pycharm安装opencv-python报错的解决
- python2.7安装opencv-python很慢且总是失败问题
- 关于pip安装opencv-python遇到的问题
- python3.6.4安装opencv3.4.2的实现
- opencv-python图像处理安装与基本操作方法
- opencv-python 开发环境的安装、配置教程详解