0

I'm trying to run a python Code. It imports cv, but when it tries to do so, the above error pops up. The only function where cv is used is

cv.Moments(points)

cv2 imports just fine and I'm on python 3.7 version. If anyone has a workaround for this specific problem? I'll be much obliged. Thank you!

saba javad
  • 13
  • 2
  • `cv` appears to be an old version of the module, which you don't have installed (based on a FAQ at https://pypi.org/project/opencv-python/). Import `cv2` and change `cv.Moments` to `cv2.Moments` (or its `cv2` equivalent). – chepner Oct 22 '19 at 15:49
  • Possible duplicate of [Cannot import cv on Opencv2](https://stackoverflow.com/questions/32048313/cannot-import-cv-on-opencv2) – crookedleaf Oct 22 '19 at 16:20
  • Do you really want to import Moments from cv ? Now it is replaced by cv2 – Yaroslav Kornachevskyi Oct 22 '19 at 18:10
  • yes, I really want cv.Moments() . I've tried cv2.Moments() . But it just throw some numpy error. – saba javad Oct 24 '19 at 05:35

0 Answers0