第一步 下载Anaconda

这里选择在清华镜像源下载合适的版本(这里使用的是anaconda3-5.2.0)
下载地址(https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/)

第二步 安装Anaconda

点击下载好的exe文件,选择合适的路径后,注意勾选下图的框
在这里插入图片描述
可以自动安装对应的python版本(这里的是3.6.5)

第三步 配置镜像源

首先安装完Anaconda后会有一个 Anaconda Prompt
在这里插入图片描述
打开 Anaconda prompt,敲命令:conda config --show channels
然后 输入

# 添加清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
 
# 添加阿里云镜像源
conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/free/
conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/main/
 
# 添加中科大源
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
 

# 设置搜索时显示通道地址
conda config --set show_channel_urls yes

也可以删除镜像源,例如:

conda config --remove channels defaults
 
conda config --remove channels https://mirrors.aliyun.com/anaconda/pkgs/free/

如果 镜像源失效,加上上面代码仍不能用

C:\Users\你电脑的用户名 该目录创建文件夹pip,然后在该文件夹内创建pip.ini文件
输入下面内容

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com

在这里插入图片描述
若还是不可以,可以在文件管理器路径输入%APPDATA%,在该路径下创建上述pip.ini文件

第三步开始安装opencv

打开Anaconda Prompt,输入

pip install opencv-python==3.4.1.15

pip install opencv-contrib-python==3.4.1.15

若出现版本兼容问题,可以在这个网站查找 网站入口
(https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv)
ctrl+f搜索opencv
在这里插入图片描述
点击之后查找对应的版本,前面代表opencv版本号,后面cp代表对应的python版本
在这里插入图片描述

GitHub 加速计划 / opencv31 / opencv
236
21
下载
OpenCV: 开源计算机视觉库
最近提交(Master分支:3 个月前 )
40ab4110 Fixed stack-use-after-scope errors in charuco detector 1 天前
b2042a61 docs(core): update Universal Intrinsics for VLA (RVV/SVE) and v4.11+ API changes 1 天前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐