赞
踩
OpenCV是一个基于Apache2.0许可(开源)发行的跨平台计算机视觉和机器学习软件库,可以运行在Linux、Windows、Android和Mac OS操作系统上。OpenCV用C++语言编写,它具有C ++,Python,Java和MATLAB接口,,OpenCV主要倾向于实时视觉应用,并在可用时利用MMX和SSE指令, 如今也提供对于C#、Ch、Ruby,GO的支持。
想要了解更多,请查阅以下百科:
在电脑里打开“命令提示符”cmd
- #cmd
- pip install opencv-python
- #或者是
- pip install opencv-contrib-python
- Defaulting to user installation because normal site-packages is not writeable
- Collecting opencv-contrib-python
- Downloading opencv_contrib_python-4.8.0.76-cp37-abi3-win_amd64.whl (44.8 MB)
- ---------------------------------------- 44.8/44.8 MB 68.3 kB/s eta 0:00:00
- Requirement already satisfied: numpy>=1.21.2 in c:\users\f'c\appdata\roaming\python\python311\site-packages (from opencv-contrib-python) (1.25.2)
- Installing collected packages: opencv-contrib-python
- Successfully installed opencv-contrib-python-4.8.0.76
- [notice] A new release of pip available: 22.3.1 -> 23.2.1
- [notice] To update, run: python.exe -m pip install --upgrade pip
根据 “[notice] To update, run: python.exe -m pip install --upgrade pip” 的提示
- #cmd
- python.exe -m pip install --upgrade pip
- Defaulting to user installation because normal site-packages is not writeable
- Requirement already satisfied: pip in c:\program files\python311\lib\site-packages (22.3.1)
- Collecting pip
- Downloading pip-23.2.1-py3-none-any.whl (2.1 MB)
- ---------------------------------------- 2.1/2.1 MB 20.0 kB/s eta 0:00:00
- Installing collected packages: pip
- WARNING: The scripts pip.exe, pip3.11.exe and pip3.exe are installed in 'C:\Users\f'c\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
- Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
- Successfully installed pip-23.2.1
- #Python
- import cv2
- print(cv2.__version__)
- Traceback (most recent call last):
- File "C:\Users\ \ \ \ .py", line 1, in <module>
- import cv2
- ModuleNotFoundError: No module named 'cv2'
这是报错的一种代码,反正报错就是安装错误。
- 4.8.0
-
- Process finished with exit code 0
只要有一个像这样的版本号就行了,不一定要4.8.0的版本号,其他的也行。
希望能够帮助到您哦~
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。