python install cv2 - resolved
My website is online http://javapub.net.cn/
Recommended collection
Provide a variety of operations, there must be one suitable for you
This is the case, it just can't be installed. There is no nonsense in this article, read it carefully.
1. Traditional way1
(execute it once, test one by one)
Try python3 -m pip install --upgrade pip
pip install cv2
pip3 install opencv-python
domestic mirror
pip3 install opencv-python -i http://pypi.mirrors.ustc.edu.cn/simple/
pip install cv2 -i http://pypi.mirrors.ustc.edu.cn/simple/
schedule:
2. The first stage of the ultimate solution 01
Switch python version, python3.9 does not support cv2 (python3.7 and below)
3. The second stage final method 02
install it yourself
https://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud
Wait for the download to complete, copy it to the lib directory under the python installation directory
Then, install it in cmd (first enter the lib directory and then install the file you downloaded)
pip install opencv_python‑2.4.13.7‑cp27‑cp27m‑win_amd64.whl
- 1
Wait for the installation to complete and verify it.
pip install numpy
- 1
4. Ultimate solution 3
2022 0902 windows10 pro test
First make sure you have python installed, here it is installed through the Anaconda3 integrated environment.
Download address: http://www.lfd.uci.edu/~gohlke/pythonlibs/
But I didn't download it successfully on this website. Finally, I tried to find the opencv image file on the website, and the download was successful on this website:
Domestic mirror website: https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/opencv-python/
I downloaded the 64-bit version of the corresponding version:opencv_python-4.2.0.32-cp37-cp37m-win_amd64.whl
Save the file to the D:\Anaconda3\Lib\site-packages folder
Go to the Anaconda3\Lib\site-packages folder
Excuting an orderpip install opencv_python-4.2.0.32-cp37-cp37m-win_amd64.whl
success:
additional
download:
If it is the above error, you may need to install OpenSSL. http://slproweb.com/products/Win32OpenSSL.html
Install:
keep going
Configure environment variables
Original address http://javapub.net.cn/posts/python/python-cv2-install.html/