Doej
Doej

Reputation: 65

ImportError: No module named cv2 error upon running .py file in terminal

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.

Upvotes: 0

Views: 576

Answers (2)

Kasim Sharif
Kasim Sharif

Reputation: 79

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

conda install opencv

solved the issue for me.

Upvotes: 0

Tupis
Tupis

Reputation: 29

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

Upvotes: 1

Related Questions