无法导入cv2模块(Python 3.6)

时间:2018-06-18 12:30:47

标签: python opencv python-3.6 cv2

总nexwbie在这里。

我没有成功为python安装 cv2 模块,但它没有成功。我正在使用Python 3.6(64位)

我在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

我试图在这个网站上寻找答案但是找不到任何答案。我发现最准确的是:https://breakthrough.github.io/Installing-OpenCV/但似乎我必须回到旧版本的Python?

2 个答案:

答案 0 :(得分:7)

尝试:

userId

答案 1 :(得分:2)

它适用于python 3.5

对于 python 3.6 ,用于OpenCV的conda install opencv和conda install -c conda-forge opencv方法继续被破坏,用于视频/图像读取和显示。

请改用以下pip install:

python -m pip安装opencv-python

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