Detailed tutorial on installing cv2 package in Anaconda

1. Find the correct version of opencv corresponding to python

Enter the command in cmd pythonto determine the current python version, and then determine whether the machine is a 32-bit system or a 64-bit system. The author corresponds to python3.8 win64

insert image description here

2. Find the corresponding version and select the corresponding image to install

1. Select the mirror image of the domestic source to download and install offline. The download address is: openvc

insert image description here

2. Download the corresponding opencv package. The author downloaded: opencv_python-3.4.10.35-cp38-cp38-win_amd64.whl , where the meaning of each symbol is:

(1) The 3.4.10.35 in front is the version number of opencv, it is not recommended to choose the latest version
(2) The cp38 in the middle means that it corresponds to the python3.8.x version
(3) The win_amd64 in the back means the 64-bit of the corresponding computer

insert image description here
3. Open Anaconda Prompt, enter the corresponding virtual environment, copy the location of the package just downloaded, directly cd+ the address to enter the directory where the downloaded package is saved, and then enter the following command, and then we can see in PyCharm that the bottom is no longer marked in import cv2red

pip install opencv_python-3.4.10.35-cp38-cp38-win_amd64.whl

insert image description here

insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/qq_44111805/article/details/128287948