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 安装错误
基础教程推荐
- 尝试制作WhatsApp机器人 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
