Pycharm/Python OpenCV and CV2 install error(Pycharm/Python OpenCV 和 CV2 安装错误)
问题描述
我一直在尝试按照建议从 Pycharm 和终端安装 OpenCV 和 cv2:
I've been trying to install both OpenCV and cv2 from both Pycharm and from the terminal as suggested using:
pip install --user opencv
pip install --user cv2
但我收到以下错误:
Collecting opencv
Could not find a version that satisfies the requirement opencv (from versions: )
No matching distribution found for opencv
和
Collecting cv2
Could not find a version that satisfies the requirement cv2 (from versions: )
No matching distribution found for cv2
如何解决这些问题并正确安装软件包?我正在使用 python 3.4.
How can I fix these and install the packages properly? I'm using python 3.4.
推荐答案
您收到这些错误是因为 opencv 和 cv2 不是 python 包名称.
You are getting those errors because opencv and cv2 are not the python package names.
这些都包含在 opencv-python 包中,可从 pip 安装.
These are both included as part of the opencv-python package available to install from pip.
如果您使用的是 python 2,则可以使用 pip 安装:
If you are using python 2 you can install with pip:
pip install opencv-python
或者使用python 3的等价物:
Or use the equivilent for python 3:
pip3 install opencv-python
运行适当的 pip 命令后,您的包应该可以在 python 中使用了.
After running the appropriate pip command your package should be available to use from python.
这篇关于Pycharm/Python OpenCV 和 CV2 安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Pycharm/Python OpenCV 和 CV2 安装错误
基础教程推荐
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 求两个直方图的卷积 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 包装空间模型 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
