[Python] python3.7 default library installation source address change and opencv_python-3.4.2.16 environment configuration

1. Some settings and URLs for accelerated downloads

1. Various versions of python and domestic download addresses

The official version download address of python:

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

Domestic Huawei mirror

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

2. The domestic image download address of the Python third-party library

python's default mirror source

Default mirror source: https://pypi.python.org/simple

watercress

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

Ali Cloud

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

Tsinghua University

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

University of Science and Technology of China

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

Temporary replacement
Example:

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


Permanent replacement
Example:
 

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

2. Environment configuration

1. Download python version 3.7 and install it;

2. Download the opencv_python-3.4.2.16-cp37-cp37m-win_amd64.whl file (find it in the library image file. I found it in Douban's library. Some files of other versions that cannot be found are found on Douban) ;

3. Install numpy-1.14.5;

Install the downloaded opencv_python-3.4.2.16-cp37-cp37m-win_amd64.whl (this file should be placed in the current working directory C:\Users\z_hua)

Install 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

Guess you like

Origin blog.csdn.net/Darren1921/article/details/130930052