How to use OpenCV in python 3.4 on windows 7 x64? [duplicate]

不羁的心 提交于 2019-12-11 00:59:41

问题


I have windows 7 x64 and python 3.4. I try to use cv2 module:

import numpy as np
import cv2

img = cv2.imread('messi5.jpg',0)

As I know, there is no way to use opencv 2 with python 3.4. Therefore, I downloaded opencv 3 beta. But I don't understand how to use this stuff for my purpose. Folder ~\opencv\build\python\ contains python 2.7 folder, but there is not python 3.4 folder.

How to solve my task?


Update (06.06.2015).

OpenCV 3 has been released. You can directly download it from official site.


回答1:


you need to build it from source using cmake. Follow the instructions of standard install procedure link, you will find OPENCVDIR/build/install/python/x64(or86)/3.4/cv.pyd. Copy this file and all the .dll files to the python site-packges dir, I was able to "import cv2"



来源:https://stackoverflow.com/questions/28925264/how-to-use-opencv-in-python-3-4-on-windows-7-x64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!