简体   繁体   English

无法导入 cv2 模块(Python 3.6)

[英]Unable to import cv2 module (Python 3.6)

total nexwbie here.总nexwbie在这里。

I'm unsuccessfully trying to install the cv2 module for python but it doesn't work.我尝试为 python 安装cv2模块失败,但它不起作用。 I'm working with Python 3.6 (64bits)我正在使用 Python 3.6(64 位)

I typed the following commands in the cmd :我在 cmd 中输入了以下命令:

C:\Users\leahj>C:\Users\leahj\AppData\Local\Programs\Python\Python36\Scripts\pip3 install cv2
Collecting cv2
  Could not find a version that satisfies the requirement cv2 (from versions: )
No matching distribution found for cv2

C:\Users\leahj>C:\Users\leahj\AppData\Local\Programs\Python\Python36\Scripts\pip3 install opencv
Collecting opencv
  Could not find a version that satisfies the requirement opencv (from versions: )
No matching distribution found for opencv

C:\Users\leahj>C:\Users\leahj\AppData\Local\Programs\Python\Python36\Scripts\pip3 install opencv2
Collecting opencv2
  Could not find a version that satisfies the requirement opencv2 (from versions: )
No matching distribution found for opencv2

I tried to look for answers on this site but couldn't find any.我试图在这个网站上寻找答案,但找不到任何答案。 The most accurate thing I found was that : https://breakthrough.github.io/Installing-OpenCV/ but it seems that I have to go back to an older version of Python ?我发现的最准确的事情是: https://breakthrough.github.io/Installing-OpenCV/但似乎我必须回到旧版本的 Python ?

试着做:

pip3 install opencv-python

It works for python 3.5它适用于 python 3.5

For python 3.6 The conda install opencv and conda install -c conda-forge opencv methods for OpenCV continue to be BROKEN for video/image reading and display.对于python 3.6 ,用于 OpenCV 的 conda install opencv 和 conda install -c conda-forge opencv 方法继续用于视频/图像读取和显示。

Use pip install below instead:使用下面的 pip install 代替:

python -m pip install opencv-python python -m pip install opencv-python

Reference: https://www.scivision.co/install-opencv-python-windows/参考: https : //www.scivision.co/install-opencv-python-windows/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM