Ask Your Question
0

OpenCV 3.3.1 python 2.7 32bit and windows 64 bit - error

asked 2017-11-26 12:58:23 -0600

I am trying to install OpenCV for python as described in this page . I already downloaded the pre-built OpenCV 3.3.1 in my C drive and I have now installed the python 2.7., numpy and Matplotlib as per this page.

  1. I copied the "cv2.pyd" from "C:\opencv_3.3.1\build\python\2.7\x86" and pasted it to "C:\Python27\Lib\site-packages"
  2. The "import cv2" works fine, but "print( cv2.__version__ )" generates the following error

    Traceback (most recent call last): File "<pyshell#3>", line 1, in <module> print(cv._version_ ) NameError: name 'cv' is not defined

I also have a python 3.6.2 version installed in my system. - Please let me know if I am doing something incorrectly? - Can I use Visual studio 2015 with this python version? - I am using 64 bit computer, is python 32 bit causing issues?

I have no clue, kindly suggest a solution. thank you!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-11-26 13:03:13 -0600

berak gravatar image

updated 2017-11-26 13:10:46 -0600

opencv3 does no more have any cv submodule. that kind of (c-based) api got deprecated long ago, and as of opencv3, they finally took a deep breath, and removed that entirely

long story short: NEVER use cv2.cv but cv2 only.

since "the internet" might drag in mostly dead things, have a look at current tutorials

edit flag offensive delete link more

Comments

2

I'm sorry i don't follow your suggestion. I'm trying to install Python and OpenCV from Open CV tutorials as I mentioned in the link for page

In the OpenCV tutorial step 7, there are two lines of code:

7 Open Python IDLE and type following codes in Python terminal.

>>> import cv2
>>> print( cv2.__version__ )

I get error after the 2nd line... there is no cv2.cv in these lines... please clarify Thank you!

OpenCV_learner gravatar imageOpenCV_learner ( 2017-11-26 13:19:19 -0600 )edit

apologies, i msread , what you're doing.

the cv2.dll you're trying to use, is for python2.7, 32bit only. (but this is probably not the issue)

berak gravatar imageberak ( 2017-11-27 01:41:31 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-11-26 12:58:23 -0600

Seen: 2,523 times

Last updated: Nov 26 '17