How to correctly install OpenCV-python in the Anaconda virtual environment

Install opencv correctly

1. An error occurred

Direct installation error
image.png

2. Solutions

1. Check the python version in the current environment: python --version
image.png
2. Enter https://www.lfd.uci.edu/~gohlke/pythonlibs/
(you can collect it, there are all kinds of libraries)
3. Ctrl+f to find opencv, or directly pull down to find the corresponding opencv
image.png

4. Find the corresponding version of OpenCV (cp311 corresponds to python3.11) and be sure to install it in the site-packages of the required OpenCV virtual environment! ! !
(Mine is in H:\anaconda\envs\tensorflow\Lib\site-packages)

image.png
(It’s 100 million points slower, and the network is disconnected in the middle)
5. Win+r, enter the directory of your installation file, use the command pip install opencv_python-4.5.5-cp311-cp311-win_amd64.whl to
install successfully! congratulations!
image.png
6. Check whether the installation is successful
image.png

Guess you like

Origin blog.csdn.net/li26324949/article/details/129738231