【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

猜你喜欢

转载自blog.csdn.net/Darren1921/article/details/130930052
今日推荐