0

I am having trouble running a python script file that contains import opencv command. Upon running the file, it gives the following error: ImportError: No module named cv2

I then ran pip install python-opencv but it gave Could not find a version that satisfies the requirement python-opencv (from versions: ) No matching distribution found for python-opencv error.

Does anyone know what the issue might be? I was able to run this python file at first but I haven't been able to run after that.

Doej
  • 75
  • 5
  • Possible duplicate of [OpenCV - cannot find module cv2](https://stackoverflow.com/questions/19876079/opencv-cannot-find-module-cv2) – Sociopath Jan 03 '18 at 11:07
  • @AkshayNevrekar well I did try the commands stated in the verified solution but the issue still persists – Doej Jan 03 '18 at 12:47
  • Try this: https://gist.github.com/blue-ice/e6bc36a906c86070eb50 – Sociopath Jan 03 '18 at 13:16
  • @AkshayNevrekar shall I run the python file after executing those commands? I tried and now I am getting `ImportError: numpy.core.multiarray failed to import` error :/ – Doej Jan 04 '18 at 07:37

2 Answers2

1

Package name is wrong pip install opencv-python Should work.

Tupis
  • 31
  • 2
  • Running this command gives error `DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.` – Doej Jan 03 '18 at 11:09
0

I also had this issue. Tried different things. But finally

conda install opencv

solved the issue for me.