The main steps:
Step one: Uninstall opencv-python (if there is installed opencv-contrib-python, need to unloading)
Step two: Install the new opencv-python and opencv-contrib-python
( A) unloading opencv do the following:
Step: window key + R, type cmd into the command line,
Into the directory where python version pip.exe;
If you can not find it, enter cmd in the command line where python, anaconda in my Scripts folder
Part II: Enter the uninstall command statement: pip uninstall opencv-python and pip uninstall opencv-contrib-python
(Note: After input statement:? Proceed (y / n) the need to enter y)
Problems encountered: If you enter the uninstall command error can not uninstall the statement appeared, the solution is: put all the documents relating to the python you're running are shut off. You can be uninstalled.
(B) installing a new opencv do the following:
Reference: https: //blog.csdn.net/qq_23981335/article/details/80545839
Whl download a file, on the opencv, Download here: Download
Download the file about the 3.4 version whl
A, Anadonda environment
Next over, into conda corresponding folder:
d: \ Anadonda3 \ Lib \ Site-Packages Standard Package
in the directory, shift + right, open a command line:
input (according to their own downloadable version 3.4.x) pip install opencv_python-3.4.0-cp36-cp36m-win_amd64.whl
Successfully !!!
check:
Type in cmd in:
Python
then:
import cv2
success! !
Second, the sheer python environment
Next over, direct E drive (any tray) to create a new "opencv" folder, download the file placed on them:
In the 'opencv' directory, shift + right, open a command line:
input (according to their own downloadable version 3.4.x) pip install opencv_python-3.4.0-cp36-cp36m-win_amd64.whl
Successfully !!!