转载请注明出处:

https://www.cnblogs.com/darkknightzh/p/12000823.html

参考网址:

https://www.imooc.com/article/34004

https://pypi.org/project/opencv-python/

在anaconda中可直接使用pip安装opencv,如下:

pip install opencv-python
pip install opencv-contrib-python

如第一个参考网址所示,国内常用pip源如下:

阿里云                       http://mirrors.aliyun.com/pypi/simple/

豆瓣(douban)            http://pypi.douban.com/simple/

清华大学                   https://pypi.tuna.tsinghua.edu.cn/simple/

中国科学技术大学        http://pypi.mirrors.ustc.edu.cn/simple/

使用时,直接加-I url即可,如果有报错说网站不可信任,根据提示加上 --trusted-host *** 即可。
如果想配置成默认的源,方法如下:
需要创建或修改配置文件(一般都是创建),linux的文件在~/.pip/pip.conf(windows在%HOMEPATH%\pip\pip.ini),修改内容为:
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
最终安装opencv的命令如下:
pip install opencv-python -i http://mirrors.aliyun.com/pypi/simple/   --trusted-host mirrors.aliyun.com
pip install opencv-contrib-python -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

(原+修改)Pip使用国内源安装opencv的更多相关文章

  1. pip 使用国内源安装第三方库

    pip3 install django -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com​

  2. linux pip使用国内源

    最近在Linux里面使用pip安装应用的速度十分的慢,于是便上网找了一些国内的源. 清华大学:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:https:// ...

  3. python 使用国内源安装软件

    python linux 等 使用国内源安装软件 速度更快 你值得拥有 ! 豆瓣源:pip install -i https://pypi.douban.com/simple/ 阿里源:pip ins ...

  4. dockerfile debian 和pip使用国内源

    python官方镜像是基于debian的.国内使用时定制一下,加快下载速度. 1 debian本身使用国内源 dockfile中: #国内debian源 ADD sources.list /etc/a ...

  5. pip换国内源

    pip换国内源 1.国内常用源   阿里云 http://mirrors.aliyun.com/pypi/simple/   中国科技大学 https://pypi.mirrors.ustc.edu. ...

  6. debian9使用国内源安装docker以及一些使用方法

    debian9使用国内源安装docker以及一些使用方法   首先, 我的环境是debian, 容器是centos debian 扔源 # deb-src [arch=amd64] https://m ...

  7. ubuntu ARM换国内源和国内源安装ROS

    ubuntu arm换国内源: https://www.cnblogs.com/yongy1030/p/10315569.html 国内源安装ROS: https://blog.csdn.net/ch ...

  8. 修改python包pip下载国内源

    第一种方式- pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ 附国内常用镜像源:阿里云:https:// ...

  9. pip使用国内源

    对于Python开发用户来讲,PIP安装软件包是家常便饭.但国外的源下载速度实在太慢,浪费时间.而且经常出现下载后安装出错问题.所以把PIP安装源替换成国内镜像,可以大幅提升下载速度,还可以提高安装成 ...

随机推荐

  1. [LeetCode] 14. Longest Common Prefix 最长共同前缀

    Write a function to find the longest common prefix string amongst an array of strings. If there is n ...

  2. golang中判断两个slice是否相等

    在golang中我们可以轻松地通过==来判断两个数组(array)是否相等,但遗憾的是slice并没有相关的运算符,当需要判断两个slice是否相等时我们只能另寻捷径了. slice相等的定义 我们选 ...

  3. C# HTTP系列7 HttpWebRequest.Method属性

    系列目录     [已更新最新开发文章,点击查看详细] HttpWebRequest.Method属性,获取或设置请求的方法.用于联系 Internet 资源的请求方法. 默认值为 GET. Syst ...

  4. ASP.NET的MVC请求处理流程

    1.用户打开浏览器,在地址栏输入某个网址的URL并回车,浏览器便开始像该URL指定的服务器发起HTTP请求 .2.服务器的网站服务系统(IIS)接收到该请求,先检查自己是否认识该类请求,如果认识就直接 ...

  5. c# CRC16位校验辅助类

    public class CRC16Helper { /// <summary> /// CRC校验 /// </summary> /// <param name=&qu ...

  6. Python连载31-threading的使用

    一. 例子:我们对传参是有要求的必须传入一个元组,否则报错 二. import _thread as thread import time def loop1(in1): print("St ...

  7. Unity Shader 屏幕后效果——Bloom外发光

    Bloom的原理很简单,主要是提取渲染图像中的亮部区域,并对亮部区域进行模糊处理,再与原始图像混合而成. 一般对亮部进行模糊处理的部分采用高斯模糊,关于高斯模糊,详见之前的另一篇博客: https:/ ...

  8. pytorch_01_基础_一维线性回归

    pytorch基础 pytorch官方文档:https://pytorch.org/docs/master/nn.html#linear-layers import torchfrom torch i ...

  9. Unity和Jenkins真是绝配,将打包彻底一键化!

    说起打包,我们的QA简直是要抓狂,这个确实我也很同情他们.项目最开始打包是另一个同事做的,打包步骤是有些繁琐,但是项目上线后,不敢轻易动啊!每次他们打包总要跟我抱怨,国内版本打包步骤要10多步还能忍, ...

  10. go-gin-api 规划目录和参数验证(二)

    概述 首先同步下项目概况: 上篇文章分享了,使用 go modules 初始化项目,这篇文章咱们分享: 规划目录结构 模型绑定和验证 自定义验证器 制定 API 返回结构 废话不多说,咱们开始吧. 规 ...