Our first choice opencv-python 3.4.1.15 edition , Because some methods needed to be patented in later versions , It's not working , This version is the last one that can use these methods , So I recommend that you choose this version . It corresponds to anaconda3-5.2.0 edition .
It will be faster to install with this image :anaconda Tsinghua mirror
1、 Use anaconda prompt, similar cmd Things that are . find anaconda Where it is , See if there is python:
2、 Get into Scripts, Use pip install opencv-python:
Instructions for :pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python==3.4.1.15
3、 There is a line of red in the above figure, which is ignored first , First, check whether the successful installation in the following prompt is really successful :
version There are two underscores before and after , The version number indicates that the installation is successful .
4、 And the red one , what did you say? msgpack No installation , So the following is installed , Students without this error do not need to install .
Instructions for :pip install msgpack
pip install msgpack-python
5、 Use pip install opencv-contrib-python :
Instructions for :pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-contrib-python==3.4.1.15
If an error occurs in the above method due to a version mismatch , Unable to install , You can choose another installation method . Is to put opencv-python Of .whl Download the file locally , Then install .
On this website :Python Extension Packages for Windows - Christoph Gohlke (uci.edu)
Click open and look inside opencv, After clicking on it, there is this :opencv
cp37 It means fit python3.7 Use
Click download to , You can download it to the front anaconda Below Scripts Under the document . And then in anaconda prompt in , Input pip install ( A long list of names for the version you chose )