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:
但我收到以下错误:
和
如何解决这些问题并正确安装软件包?我正在使用 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:
或者使用python 3的等价物:
Or use the equivilent for python 3:
运行适当的 pip 命令后,您的包应该可以在 python 中使用了.
After running the appropriate pip command your package should be available to use from python.
这篇关于Pycharm/Python OpenCV 和 CV2 安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!