【Python】python3.7默认库安装源地址更改及opencv_python-3.4.2.16环境配置

一、加速下载的部分设置及网址

1、python各版本及国内下载地址

python官方各版本下载地址:

https://www.python.org/ftp/python/

国内华为镜像

https://mirrors.huaweicloud.com/python/

2、Python 第三方库国内镜像下载地址

python的默认镜像源

默认镜像源:https://pypi.python.org/simple

豆瓣

  • http://pypi.douban.com/simple/

阿里云

  • http://mirrors.aliyun.com/pypi/simple/

清华大学

  • https://pypi.tuna.tsinghua.edu.cn/simple

中国科技大学

  • https://pypi.mirrors.ustc.edu.cn/simple/

临时更换
例:

pip install package -i https://pypi.tuna.tsinghua.edu.cn/simple


永久更换
例:
 

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

二、环境配置

1、下载3.7版本python并安装;

2、下载opencv_python-3.4.2.16-cp37-cp37m-win_amd64.whl文件(在库镜像文件里面找,我实在豆瓣的库里找的,其他版本的文件有些找不到的都是在豆瓣找到的);

3、安装numpy-1.14.5;

安装下载的opencv_python-3.4.2.16-cp37-cp37m-win_amd64.whl(这个文件要放到当前工作目录C:\Users\z_hua下)

安装opencv-contrib-python==3.4.2.16

C:\Users\z_hua>pip install numpy==1.14.5 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple
Collecting numpy==1.14.5
  Downloading http://pypi.doubanio.com/packages/94/80/c49b01d8632f58aef25fbe9a05be56339b7bb94b1eefd4f5d8c087d002b5/numpy-1.14.5-cp37-none-win_amd64.whl (13.4MB)
    100% |████████████████████████████████| 13.4MB 10.2MB/s
Installing collected packages: numpy
Successfully installed numpy-1.14.5
C:\Users\z_hua>pip install opencv_python-3.4.2.16-cp37-cp37m-win_amd64.whl
Processing c:\users\z_hua\opencv_python-3.4.2.16-cp37-cp37m-win_amd64.whl
Requirement already satisfied: numpy>=1.14.5 in c:\users\z_hua\appdata\local\programs\python\python37\lib\site-packages (from opencv-python==3.4.2.16) (1.14.5)
Installing collected packages: opencv-python
Successfully installed opencv-python-3.4.2.16
C:\Users\z_hua>pip install opencv-contrib-python==3.4.2.16 -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/opencv-contrib-python/
Looking in indexes: https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/opencv-contrib-python/
Collecting opencv-contrib-python==3.4.2.16
  Could not find a version that satisfies the requirement opencv-contrib-python==3.4.2.16 (from versions: )
No matching distribution found for opencv-contrib-python==3.4.2.16
## 清华的库里面就找不到这个版本
C:\Users\z_hua>pip install opencv-contrib-python==3.4.2.16 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple
Collecting opencv-contrib-python==3.4.2.16
  Downloading http://pypi.doubanio.com/packages/a2/1c/778cb8a5f4026d49e299d34a98791599f7485553c29889385c43158b6f43/opencv_contrib_python-3.4.2.16-cp37-cp37m-win_amd64.whl (39.6MB)
    100% |████████████████████████████████| 39.6MB 5.0MB/s
Requirement already satisfied: numpy>=1.14.5 in c:\users\z_hua\appdata\local\programs\python\python37\lib\site-packages (from opencv-contrib-python==3.4.2.16) (1.14.5)
Installing collected packages: opencv-contrib-python
Successfully installed opencv-contrib-python-3.4.2.16

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值