The coexistence of python2 and python3
One, manually configure environment variables
1) After downloading python2, if you don't check Add Python 3.6 to PATH, you need to set it manually.
2) Change the python.exe and pythonw.exe in the downloaded python to python2.exe and pythonw.exe
3) Add the two paths where you installed python in the system variables:
D:\Program Files\Python37\Scripts
D :\Program Files\Python37
4) Confirm and complete.
Second, use the specified python in cmd
1. Check the python2 version:
python2
2. Use python2 to download the package to the specified directory:
python2 -m pip install opencv-python
3. View the package list in
python2 : python2 -m pip list
4. Set the specified pip download mirror
cmd>>> Enter %appdata%>>>After opening the specified directory, create a new pip directory, create a new pip.ini file, and enter the following:
[global]
timeout = 1000 //Timeout
index-url = https://pypi.tuna.tsinghua. edu.cn/simple //(Mirror address)
[install]
trusted-host = pypi.douban.com